From ef769a27fc2718d2af2e2a9fc3949c1d9fee0240 Mon Sep 17 00:00:00 2001 From: buchananwill <139961977+buchananwill@users.noreply.github.com> Date: Fri, 29 Mar 2024 18:32:17 +0000 Subject: [PATCH] Removing btn daisy classnames. --- .../[yearGroup]/bundles/bundle-editor.tsx | 11 +- app/electives/commit-changes.tsx | 23 +- .../components/buttons/rename-button.tsx | 15 +- .../components/buttons/two-stage-click.tsx | 36 +- app/generic/components/zoom/zoom-button.tsx | 7 +- .../editing/buttons/graph-edit-button.tsx | 10 +- .../curriculum-delivery-details.tsx | 19 +- .../work-task-types/rename-work-task-type.tsx | 42 + .../work-task-type-dto-details.tsx | 47 +- app/layout.tsx | 32 +- app/root-providers.tsx | 28 + package-lock.json | 2802 ++++++++++++++++- package.json | 2 + tailwind.config.ts | 8 +- 14 files changed, 2903 insertions(+), 179 deletions(-) create mode 100644 app/graphing/graph-types/work-task-types/rename-work-task-type.tsx create mode 100644 app/root-providers.tsx diff --git a/app/curriculum/delivery-models/[yearGroup]/bundles/bundle-editor.tsx b/app/curriculum/delivery-models/[yearGroup]/bundles/bundle-editor.tsx index eeda6d4..ec449e5 100644 --- a/app/curriculum/delivery-models/[yearGroup]/bundles/bundle-editor.tsx +++ b/app/curriculum/delivery-models/[yearGroup]/bundles/bundle-editor.tsx @@ -212,17 +212,14 @@ export function BundleEditor({ const { name: nameOfBundle } = sortedBundleList[activeTab]; return ( - - Current Tab:{' '} + <div className={'w-full flex items-center pb-2'}> + <Title>Current Tab: - deleteBundle(activeBundleAndId.id)} - className={'btn-sm'} - > + deleteBundle(activeBundleAndId.id)}> @@ -230,7 +227,7 @@ export function BundleEditor({ Curriculum Bundles - Year {yearGroup} - Total All Bundles:{' '} {sumOfAllBundles} - +
diff --git a/app/electives/commit-changes.tsx b/app/electives/commit-changes.tsx index a0385f3..5acac45 100644 --- a/app/electives/commit-changes.tsx +++ b/app/electives/commit-changes.tsx @@ -16,6 +16,7 @@ import { ConfirmActionModal, useModal } from '../generic/components/modals/confirm-action-modal'; +import { Button } from '@nextui-org/react'; interface Props { children: React.ReactNode; @@ -43,11 +44,6 @@ const CommitChanges = ({ children }: Props) => { const dispatch = useContext(ElectiveDispatchContext); - const assignmentConflictCount = useSearchParams()?.get('assignmentConflict'); - - const conflictCountInt = - assignmentConflictCount && parseInt(assignmentConflictCount); - async function handleCommitClick() { setCommitPending(true); @@ -75,22 +71,17 @@ const CommitChanges = ({ children }: Props) => { ); return ( -
+ <> - + @@ -111,7 +102,7 @@ const CommitChanges = ({ children }: Props) => { >

Commit changes to the database

-
+ ); }; diff --git a/app/generic/components/buttons/rename-button.tsx b/app/generic/components/buttons/rename-button.tsx index c4cca78..2036a94 100644 --- a/app/generic/components/buttons/rename-button.tsx +++ b/app/generic/components/buttons/rename-button.tsx @@ -1,5 +1,6 @@ import { PencilSquareIcon } from '@heroicons/react/20/solid'; import React from 'react'; +import { Button, ButtonProps } from '@nextui-org/react'; export type GenericButtonProps = React.DetailedHTMLProps< React.ButtonHTMLAttributes, @@ -9,17 +10,19 @@ export type GenericButtonProps = React.DetailedHTMLProps< export function RenameButton({ currentName, className, - ...props + ...buttonProps }: { currentName?: string; -} & GenericButtonProps) { +} & ButtonProps) { return ( - + ); } diff --git a/app/generic/components/buttons/two-stage-click.tsx b/app/generic/components/buttons/two-stage-click.tsx index aac93ce..91e0f1d 100644 --- a/app/generic/components/buttons/two-stage-click.tsx +++ b/app/generic/components/buttons/two-stage-click.tsx @@ -2,18 +2,19 @@ import React, { useRef, useState } from 'react'; import { Badge } from '@tremor/react'; import { offset, useFloating } from '@floating-ui/react'; import { GenericButtonProps } from './rename-button'; +import { Button } from '@nextui-org/react'; export function TwoStageClick({ children, onClick, - standardAppearance = 'btn-outline', - primedAppearance = 'btn-error', + standardAppearance = 'ghost', + primedAppearance = 'danger', primedMessage = 'Confirm delete?', className, ...props }: { - standardAppearance?: 'btn-outline' | 'btn-ghost'; - primedAppearance?: 'btn-error' | 'btn-primary'; + standardAppearance?: 'light' | 'ghost'; + primedAppearance?: 'danger' | 'primary'; primedMessage?: string; } & GenericButtonProps) { const [clickPrimed, setClickPrimed] = useState(false); @@ -35,29 +36,28 @@ export function TwoStageClick({ }; return ( - {clickPrimed && (
- + {primedMessage}
)} - {children} - +
); } diff --git a/app/generic/components/zoom/zoom-button.tsx b/app/generic/components/zoom/zoom-button.tsx index 6e9d5b9..7dfd4b4 100644 --- a/app/generic/components/zoom/zoom-button.tsx +++ b/app/generic/components/zoom/zoom-button.tsx @@ -3,13 +3,14 @@ import { useContext } from 'react'; import { ZoomDispatchContext, ZoomType } from './zoom-context'; import { MinusCircleIcon, PlusCircleIcon } from '@heroicons/react/24/outline'; +import { Button } from '@nextui-org/react'; export default function ZoomButton({ direction }: { direction: ZoomType }) { const zoomDispatchContext = useContext(ZoomDispatchContext); const callback = zoomDispatchContext[direction]; return ( - + ); } diff --git a/app/graphing/editing/buttons/graph-edit-button.tsx b/app/graphing/editing/buttons/graph-edit-button.tsx index b9792a6..d39e7d7 100644 --- a/app/graphing/editing/buttons/graph-edit-button.tsx +++ b/app/graphing/editing/buttons/graph-edit-button.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { Button, ButtonProps } from '@nextui-org/react'; export function GraphEditButton({ noNodeSelected, @@ -7,12 +8,9 @@ export function GraphEditButton({ }: { noNodeSelected: boolean; children: string; -} & React.DetailedHTMLProps< - React.ButtonHTMLAttributes, - HTMLButtonElement ->) { +} & ButtonProps) { return ( - + ); } diff --git a/app/graphing/graph-types/organization/curriculum-delivery-details.tsx b/app/graphing/graph-types/organization/curriculum-delivery-details.tsx index 639e8af..23e3fc9 100644 --- a/app/graphing/graph-types/organization/curriculum-delivery-details.tsx +++ b/app/graphing/graph-types/organization/curriculum-delivery-details.tsx @@ -11,6 +11,7 @@ import { useSumAllSchemasMemo } from '../../../curriculum/delivery-models/functi import { useSchemaBundleAssignmentContext } from '../../../curriculum/delivery-models/functions/use-schema-bundle-assignment-context'; import { RenameModal } from '../../../generic/components/modals/rename-modal'; import { GenericButtonProps } from '../../../generic/components/buttons/rename-button'; +import { Button, ButtonProps } from '@nextui-org/react'; export const LeftCol = 'text-xs w-full text-center h-full flex items-center justify-center'; @@ -59,10 +60,10 @@ export default function CurriculumDeliveryDetails({
Block:
- +
- + @@ -149,17 +147,18 @@ function CourseSummary({ export const NodeDetailsListBoxButton = forwardRef( function NodeDetailsListBoxButton( - { children, ...props }: Omit, + { children, ...props }: Omit, ref: React.ForwardedRef ) { return ( - + ); } ); diff --git a/app/graphing/graph-types/work-task-types/rename-work-task-type.tsx b/app/graphing/graph-types/work-task-types/rename-work-task-type.tsx new file mode 100644 index 0000000..32398f6 --- /dev/null +++ b/app/graphing/graph-types/work-task-types/rename-work-task-type.tsx @@ -0,0 +1,42 @@ +import React, { PropsWithChildren } from 'react'; +import { LeftCol } from '../organization/curriculum-delivery-details'; +import { DataNode } from '../../../api/zod-mods'; +import { WorkTaskTypeDto } from '../../../api/dtos/WorkTaskTypeDtoSchema'; +import { useNodeNameEditing } from '../../editing/functions/use-node-name-editing'; +import { Button } from '@nextui-org/react'; +import { PencilSquareIcon } from '@heroicons/react/20/solid'; +import { RenameModal } from '../../../generic/components/modals/rename-modal'; + +export const WorkTaskTypeDtoDetailsListenerKey = 'work-task-type-details'; + +export function ColumnOne({ children }: PropsWithChildren) { + return
{children}
; +} + +export function ColumnsTwoToFour({ children }: PropsWithChildren) { + return
{children}
; +} + +export function RenameWorkTaskType({ node }: { node: DataNode }) { + const { + id, + data: { name } + } = node; + const listenerKey = `${WorkTaskTypeDtoDetailsListenerKey}:${id}`; + const { openModal, renameModalProps } = useNodeNameEditing(node, listenerKey); + return ( + <> + Name: + + + + + + ); +} \ No newline at end of file diff --git a/app/graphing/graph-types/work-task-types/work-task-type-dto-details.tsx b/app/graphing/graph-types/work-task-types/work-task-type-dto-details.tsx index c01acdb..048364a 100644 --- a/app/graphing/graph-types/work-task-types/work-task-type-dto-details.tsx +++ b/app/graphing/graph-types/work-task-types/work-task-type-dto-details.tsx @@ -1,55 +1,22 @@ 'use client'; import { DataNode } from '../../../api/zod-mods'; -import React, { Fragment, PropsWithChildren } from 'react'; +import React, { Fragment } from 'react'; import { WorkTaskTypeDto } from '../../../api/dtos/WorkTaskTypeDtoSchema'; -import { PencilSquareIcon } from '@heroicons/react/20/solid'; import { - LeftCol, NodeDetailsListBoxButton, NodeDetailsListBoxOption, NodeDetailsListBoxOptions } from '../organization/curriculum-delivery-details'; - -import { useNodeNameEditing } from '../../editing/functions/use-node-name-editing'; import { useServiceCategoryContext } from '../../../work-types/lessons/use-service-category-context'; import { Listbox } from '@headlessui/react'; import { StringMap } from '../../../contexts/string-map-context/string-map-reducer'; import { useDirectSimRefEditsDispatch } from '../../editing/functions/use-graph-edit-button-hooks'; -import { RenameModal } from '../../../generic/components/modals/rename-modal'; - -const WorkTaskTypeDtoDetailsListenerKey = 'work-task-type-details'; - -function ColumnOne({ children }: PropsWithChildren) { - return
{children}
; -} - -function ColumnsTwoToFour({ children }: PropsWithChildren) { - return
{children}
; -} - -function RenameWorkTaskType({ node }: { node: DataNode }) { - const { - id, - data: { name } - } = node; - const listenerKey = `${WorkTaskTypeDtoDetailsListenerKey}:${id}`; - const { openModal, renameModalProps } = useNodeNameEditing(node, listenerKey); - return ( - <> - Name: - - - - - - ); -} +import { + ColumnOne, + ColumnsTwoToFour, + RenameWorkTaskType, + WorkTaskTypeDtoDetailsListenerKey +} from './rename-work-task-type'; export default function WorkTaskTypeDtoDetails({ node diff --git a/app/layout.tsx b/app/layout.tsx index ecdd639..3b38b51 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -11,6 +11,8 @@ import AnimationSyncContextProvider from './contexts/animation-sync-context/anim import ColorCodingProvider from './generic/components/color/color-coding-provider'; import SelectiveContextCollection from './selective-context/components/selective-context-collection'; import KeyListenerManager from './generic/components/key-listener-context/key-listener-manager'; +import { NextUIProvider } from '@nextui-org/system'; +import RootProviders from './root-providers'; enableMapSet(); @@ -28,26 +30,16 @@ export default async function RootLayout({ return ( - - - - - - - -