-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/-focus-mode-(#110)' of https://github.com/Undeadlo…
…l1/flow-todo into feat/-focus-mode-(#110)
- Loading branch information
Showing
15 changed files
with
156 additions
and
116 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
declare module 'react-use-toggle'; | ||
declare module 'react-kawaii'; | ||
declare module 'react-firebaseui-localized'; |
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
19 changes: 19 additions & 0 deletions
19
src/components/ui/EmotionIconButton/EmotionIconButton.stories.tsx
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,19 @@ | ||
import React from 'react'; | ||
import { sections } from '../../storybookContants'; | ||
import { | ||
EmotionIconButton, | ||
EmotionIconButtonProps, | ||
} from '../EmotionIconButton'; | ||
|
||
export default { | ||
component: EmotionIconButton, | ||
title: `${sections.ui}EmotionIconButton`, | ||
}; | ||
|
||
const props = { | ||
type: 'happy_face', | ||
onClick: console.log, | ||
} as EmotionIconButtonProps; | ||
|
||
export const Demo = (args) => <EmotionIconButton {...args} />; | ||
Demo.args = props; |
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,50 @@ | ||
import { IconButton, useTheme } from '@material-ui/core'; | ||
import React, { memo } from 'react'; | ||
import { Planet } from 'react-kawaii'; | ||
|
||
type EmotionTypes = 'happy_face' | 'sad_face'; | ||
|
||
export interface EmotionIconButtonProps { | ||
type: EmotionTypes; | ||
onClick?: ( | ||
event: React.MouseEvent<HTMLButtonElement, MouseEvent>, | ||
) => void; | ||
} | ||
const EmotionIconButton = memo(function EmotionIconButton({ | ||
type, | ||
onClick, | ||
}: EmotionIconButtonProps) { | ||
const theme = useTheme(); | ||
|
||
function geticon() { | ||
const kawaiiIconSize = 75; | ||
switch (type) { | ||
case 'happy_face': | ||
return ( | ||
<Planet | ||
mood="happy" | ||
size={kawaiiIconSize} | ||
color={theme.palette.primary.main} | ||
/> | ||
); | ||
case 'sad_face': | ||
return ( | ||
<Planet | ||
mood="sad" | ||
size={kawaiiIconSize} | ||
color={theme.palette.secondary.main} | ||
/> | ||
); | ||
} | ||
} | ||
|
||
return ( | ||
<IconButton style={{ padding: 0 }} onClick={onClick}> | ||
{geticon()} | ||
</IconButton> | ||
); | ||
}); | ||
|
||
EmotionIconButton.displayName = 'EmotionIconButton'; | ||
|
||
export { EmotionIconButton }; |
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 @@ | ||
export * from './EmotionIconButton'; |
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
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
Oops, something went wrong.