-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #799 from NSUWAL123/fix-explore-projects
Fix explore projects
- Loading branch information
Showing
10 changed files
with
688 additions
and
201 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import * as SwitchPrimitives from '@radix-ui/react-switch'; | ||
import { cn } from '../../utilfunctions/shadcn'; | ||
|
||
const Switch = React.forwardRef< | ||
React.ElementRef<typeof SwitchPrimitives.Root>, | ||
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> | ||
>(({ className, ...props }, ref) => ( | ||
<SwitchPrimitives.Root | ||
className={cn( | ||
`peer focus-visible:fmtm-ring-offset-background data-[state=checked]:fmtm-bg-primary-900 fmtm-inline-flex fmtm-h-[24px] fmtm-w-[44px] fmtm-shrink-0 fmtm-cursor-pointer | ||
fmtm-items-center fmtm-rounded-full fmtm-border-2 fmtm-border-transparent | ||
fmtm-transition-colors focus-visible:fmtm-outline-none focus-visible:fmtm-ring-2 | ||
focus-visible:fmtm-ring-offset-2 disabled:fmtm-cursor-not-allowed disabled:fmtm-opacity-50 | ||
data-[state=unchecked]:fmtm-bg-grey-400 `, | ||
className, | ||
)} | ||
{...props} | ||
ref={ref} | ||
> | ||
<SwitchPrimitives.Thumb | ||
className={cn( | ||
`fmtm-pointer-events-none fmtm-block fmtm-h-5 fmtm-w-5 fmtm-rounded-full fmtm-bg-white | ||
fmtm-shadow-lg fmtm-ring-0 fmtm-transition-transform | ||
data-[state=checked]:fmtm-translate-x-5 data-[state=unchecked]:fmtm-translate-x-0`, | ||
)} | ||
/> | ||
</SwitchPrimitives.Root> | ||
)); | ||
Switch.displayName = SwitchPrimitives.Root.displayName; | ||
|
||
export default Switch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
|
||
import CoreModules from "../../shared/CoreModules"; | ||
import CoreModules from '../../shared/CoreModules'; | ||
const HomeSlice = CoreModules.createSlice({ | ||
name: 'home', | ||
initialState: { | ||
homeProjectSummary: [], | ||
homeProjectLoading: true, | ||
selectedProject: {}, | ||
dialogStatus: false, | ||
snackbar: { | ||
open: false, | ||
message: '', | ||
variant: 'info', | ||
duration: 0 | ||
}, | ||
name: 'home', | ||
initialState: { | ||
homeProjectSummary: [], | ||
homeProjectLoading: true, | ||
selectedProject: {}, | ||
dialogStatus: false, | ||
snackbar: { | ||
open: false, | ||
message: '', | ||
variant: 'info', | ||
duration: 0, | ||
}, | ||
reducers: { | ||
SetHomeProjectSummary(state, action) { | ||
state.homeProjectSummary = action.payload | ||
}, | ||
HomeProjectLoading(state, action) { | ||
state.homeProjectLoading = action.payload | ||
}, | ||
SetSelectedProject(state, action) { | ||
state.selectedProject = action.payload | ||
}, | ||
SetDialogStatus(state, action) { | ||
state.dialogStatus = action.payload | ||
}, | ||
SetSnackBar(state, action) { | ||
state.snackbar = action.payload | ||
}, | ||
} | ||
}) | ||
|
||
showMapStatus: false, | ||
}, | ||
reducers: { | ||
SetHomeProjectSummary(state, action) { | ||
state.homeProjectSummary = action.payload; | ||
}, | ||
HomeProjectLoading(state, action) { | ||
state.homeProjectLoading = action.payload; | ||
}, | ||
SetSelectedProject(state, action) { | ||
state.selectedProject = action.payload; | ||
}, | ||
SetDialogStatus(state, action) { | ||
state.dialogStatus = action.payload; | ||
}, | ||
SetSnackBar(state, action) { | ||
state.snackbar = action.payload; | ||
}, | ||
SetShowMapStatus(state, action) { | ||
state.showMapStatus = action.payload; | ||
}, | ||
}, | ||
}); | ||
|
||
export const HomeActions = HomeSlice.actions; | ||
export default HomeSlice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { clsx, type ClassValue } from 'clsx'; | ||
import { twMerge } from 'tailwind-merge'; | ||
|
||
export function cn(...inputs: ClassValue[]) { | ||
return twMerge(clsx(inputs)); | ||
} |
Oops, something went wrong.