-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2593c34
commit 47327ce
Showing
8 changed files
with
112 additions
and
25 deletions.
There are no files selected for viewing
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,23 @@ | ||
import { darkModeState } from "@src/store"; | ||
import React from "react"; | ||
import { useRecoilValue } from "recoil"; | ||
|
||
interface ZButtonProps { | ||
children: React.ReactNode; | ||
onClick?: () => void; | ||
className?: string; | ||
} | ||
|
||
const ZButton: React.FC<ZButtonProps> = ({ children, onClick, className }) => { | ||
const darkModeStatus = useRecoilValue(darkModeState); | ||
|
||
const combinedClassName = `${className} default-btn${darkModeStatus ? "-dark" : ""}`; | ||
|
||
return ( | ||
<button type="button" className={combinedClassName} onClick={onClick}> | ||
{children} | ||
</button> | ||
); | ||
}; | ||
|
||
export default ZButton; |
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,28 @@ | ||
import React, { useRef } from "react"; | ||
Check warning on line 1 in src/components/GoalsComponents/MyGoal/MoveGoalGuide.tsx GitHub Actions / runner / eslint
|
||
import { Tour } from "antd"; | ||
import type { TourProps } from "antd"; | ||
import { useRecoilState } from "recoil"; | ||
import { moveGoalState } from "@src/store/moveGoalState"; | ||
|
||
const MoveGoalGuide: React.FC = ({ goalComponentRef }: { goalComponentRef: React.MutableRefObject<null> }) => { | ||
const [moveGoal, setMoveGoal] = useRecoilState(moveGoalState); | ||
|
||
const steps: TourProps["steps"] = [ | ||
{ | ||
title: "Navigate to the goal you want to move into.", | ||
target: () => goalComponentRef.current, | ||
nextButtonProps: { | ||
children: "Close", | ||
}, | ||
placement: "bottom", | ||
className: "move-goal-guide", | ||
}, | ||
]; | ||
return ( | ||
<div> | ||
<Tour closable open={!!moveGoal} onClose={() => setMoveGoal(null)} steps={steps} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MoveGoalGuide; |
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,6 @@ | ||
.move-goal-guide { | ||
width: 250px; | ||
.ant-tour-title { | ||
font-size: 14px; | ||
} | ||
} |
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