-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: move send assets thunk to feature * feat: add new passkey icon and use when loading passkey * style: update more information toggle styling * feat: add notice component * refactor: fix some lint warnings
- Loading branch information
1 parent
7969090
commit f52ca54
Showing
25 changed files
with
215 additions
and
91 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
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,76 @@ | ||
import { HStack, Icon, Text } from '@chakra-ui/react'; | ||
import React, { type FC, useMemo } from 'react'; | ||
import { IoInformationCircleOutline, IoWarningOutline } from 'react-icons/io5'; | ||
|
||
// constants | ||
import { DEFAULT_GAP } from '@extension/constants'; | ||
|
||
// types | ||
import type { IProps } from './types'; | ||
|
||
const Notice: FC<IProps> = ({ message, size = 'md', type = 'info' }) => { | ||
// misc | ||
const backgroundColor = useMemo(() => { | ||
switch (type) { | ||
case 'warning': | ||
return 'orange.100'; | ||
case 'info': | ||
default: | ||
return 'blue.100'; | ||
} | ||
}, [type]); | ||
const borderColor = useMemo(() => { | ||
switch (type) { | ||
case 'warning': | ||
return 'orange.600'; | ||
case 'info': | ||
default: | ||
return 'blue.600'; | ||
} | ||
}, [type]); | ||
const icon = useMemo(() => { | ||
switch (type) { | ||
case 'warning': | ||
return IoWarningOutline; | ||
case 'info': | ||
default: | ||
return IoInformationCircleOutline; | ||
} | ||
}, [type]); | ||
let iconSize = useMemo(() => { | ||
switch (size) { | ||
case 'lg': | ||
return 10; | ||
case 'sm': | ||
return 6; | ||
case 'xs': | ||
return 3; | ||
case 'md': | ||
default: | ||
return 8; | ||
} | ||
}, []); | ||
|
||
return ( | ||
<HStack | ||
backgroundColor={backgroundColor} | ||
borderColor={borderColor} | ||
borderRadius="md" | ||
borderStyle="solid" | ||
borderWidth={1} | ||
px={DEFAULT_GAP / 3} | ||
py={1} | ||
spacing={DEFAULT_GAP / 3} | ||
> | ||
{/*icon*/} | ||
<Icon as={icon} color={borderColor} h={iconSize} w={iconSize} /> | ||
|
||
{/*message*/} | ||
<Text as="b" color={borderColor} fontSize={size} textAlign="left"> | ||
{message} | ||
</Text> | ||
</HStack> | ||
); | ||
}; | ||
|
||
export default Notice; |
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 { default } from './Notice'; |
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,7 @@ | ||
interface IProps { | ||
message: string; | ||
size?: 'lg' | 'md' | 'sm' | 'xs'; | ||
type?: 'info' | 'warning'; | ||
} | ||
|
||
export default IProps; |
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 type { default as IProps } from './IProps'; |
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 was deleted.
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,6 @@ | ||
enum ThunkEnum { | ||
CreateUnsignedTransactions = 'sendAssets/createUnsignedTransactions', | ||
SubmitTransactions = 'sendAssets/submitTransactions', | ||
} | ||
|
||
export default ThunkEnum; |
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 { default as ThunkEnum } from './ThunkEnum'; |
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.