-
Notifications
You must be signed in to change notification settings - Fork 10
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
Showing
31 changed files
with
180 additions
and
808 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
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
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,35 @@ | ||
import { Question, Warning, WarningCircle } from '@phosphor-icons/react'; | ||
import React, { useState, useMemo } from 'react'; | ||
|
||
interface TagProps { | ||
name: string; | ||
backgroundColor: string; | ||
} | ||
|
||
const Tag = ({ backgroundColor, name }) => { | ||
const textColor = useMemo(() => { | ||
const color = | ||
backgroundColor.charAt(0) === '#' | ||
? backgroundColor.substring(1, 7) | ||
: backgroundColor; | ||
const r = parseInt(color.substring(0, 2), 16); // hexToR | ||
const g = parseInt(color.substring(2, 4), 16); // hexToG | ||
const b = parseInt(color.substring(4, 6), 16); // hexToB | ||
return r * 0.299 + g * 0.587 + b * 0.114 > 186 ? '#000000' : '#FFFFFF'; | ||
}, [backgroundColor]); | ||
|
||
return ( | ||
<span | ||
style={{ | ||
backgroundColor, | ||
color: textColor, | ||
padding: '4px 8px', | ||
borderRadius: '4px', | ||
}} | ||
> | ||
{name} | ||
</span> | ||
); | ||
}; | ||
|
||
export default Tag; |
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,20 @@ | ||
import { Question, Warning, WarningCircle } from '@phosphor-icons/react'; | ||
import React from 'react'; | ||
|
||
interface TipProps { | ||
message: string; | ||
type: 'error' | 'info' | 'question'; | ||
} | ||
|
||
const infoIcon = <WarningCircle size={32} color="#d7c692" weight="bold" />; | ||
const questionIcon = <Question size={32} color="#d7c692" weight="bold" />; | ||
const errorIcon = <Warning size={32} color="#d7c692" weight="bold" />; | ||
|
||
export default function Tip({ message, type }: TipProps) { | ||
return ( | ||
<div className="flex justify-center items-center"> | ||
{type === 'info' ? infoIcon : type === 'error' ? errorIcon : questionIcon} | ||
<div className="text-main-orange text-sm font-bold italic">{message}</div> | ||
</div> | ||
); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.