-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add some global components #2
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn prettier | ||
git add . |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
interface Props { | ||
text: JSX.Element | string | ||
onClick: any | ||
} | ||
|
||
const CopyButton = ({ text, onClick }: Props) => { | ||
return ( | ||
<> | ||
{text} | ||
<a onClick={onClick} className="money money-sm copy-icon sm-margin-left-xs" /> | ||
</> | ||
) | ||
} | ||
|
||
export default CopyButton |
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,12 @@ | ||
import React from 'react' | ||
import styles from './style.module.scss' | ||
|
||
interface Props { | ||
children: React.ReactElement | ||
} | ||
|
||
const BackgroundCard = ({ children }: Props) => { | ||
return <div className={styles.backgroundCard}>{children}</div> | ||
} | ||
|
||
export default BackgroundCard |
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 './BackgroundCard' |
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,22 @@ | ||
.backgroundCard { | ||
box-sizing: border-box; | ||
|
||
/* Auto layout */ | ||
|
||
/* White Color/50 */ | ||
|
||
background: var(--border-color); | ||
/* White Color/50 */ | ||
|
||
border: 1px solid var(--border-color); | ||
backdrop-filter: blur(42px); | ||
/* Note: backdrop-filter has minimal browser support */ | ||
|
||
border-radius: 16px; | ||
|
||
/* Inside auto layout */ | ||
|
||
flex: none; | ||
order: 0; | ||
flex-grow: 0; | ||
} |
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,25 @@ | ||
import BackgroundCard from '../Background/BackgroundCard' | ||
|
||
interface ItemComponent { | ||
label: string | ||
content: JSX.Element | string | ||
} | ||
|
||
interface Props { | ||
items: ItemComponent[] | ||
} | ||
|
||
const ItemsCard = ({ items }: Props) => { | ||
return ( | ||
<BackgroundCard> | ||
{items.map((item: ItemComponent) => ( | ||
<Row key={item.label}> | ||
<div className={styles.cardLabel}>{item.label}</div> | ||
<div className={styles.cardContent}>{item.content}</div> | ||
</Row> | ||
))} | ||
</BackgroundCard> | ||
) | ||
} | ||
|
||
export default ItemsCard |
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,9 @@ | ||
import styles from './style.module.scss' | ||
|
||
interface Props {} | ||
|
||
const StaticsCard = ({ items }: Props) => { | ||
return <div className={styles.staticsCard}></div> | ||
} | ||
|
||
export default StaticsCard |
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,13 @@ | ||
.itemsCard { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
|
||
padding: 48px 32px; | ||
} | ||
|
||
.cardLabel { | ||
} | ||
|
||
.cardContent { | ||
} |
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
Empty file.
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,13 @@ | ||
import React from 'react' | ||
import clsx from 'clsx' | ||
import styles from './style.module.scss' | ||
|
||
interface Props { | ||
children: JSX.Element[] | ||
} | ||
|
||
const BackgroundRow = ({ children }: Props) => { | ||
return <div className={clsx(styles.row, styles.blockRow, styles.backgroundRow)}>{children}</div> | ||
} | ||
|
||
export default BackgroundRow |
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 React from 'react' | ||
import clsx from 'clsx' | ||
import styles from './style.module.scss' | ||
import RowType from './RowType' | ||
|
||
interface Props { | ||
children: JSX.Element[] | ||
type: 'success' | 'error' | ||
} | ||
|
||
const GradientRow = ({ children, type }: Props) => { | ||
return ( | ||
<div className={clsx(styles.row, styles.blockRow, styles.gradientRow)}> | ||
<RowType type={type} /> | ||
{children} | ||
</div> | ||
) | ||
} | ||
|
||
export default GradientRow |
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,13 @@ | ||
import clsx from 'clsx' | ||
import styles from './style.module.scss' | ||
|
||
interface Props { | ||
className?: string[] | ||
children: JSX.Element[] | ||
} | ||
|
||
const Row = ({ children, className = [] }: Props) => { | ||
return <div className={clsx(styles.row, ...className)}>{children}</div> | ||
} | ||
|
||
export default Row |
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,14 @@ | ||
import React from 'react' | ||
import clsx from 'clsx' | ||
import styles from './style.module.scss' | ||
|
||
interface Props { | ||
type: 'success' | 'error' | ||
} | ||
|
||
const RowType = ({ type }: Props) => { | ||
const style = type === 'success' ? styles.success : styles.error | ||
return <div className={clsx(styles.rowType, style)}></div> | ||
} | ||
|
||
export default RowType |
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,2 @@ | ||
export * from './GradientRow' | ||
export * from './BackgroundRow' |
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,53 @@ | ||
.row { | ||
display: flex; | ||
flex-direction: row; | ||
flex: 1; | ||
} | ||
|
||
.blockRow { | ||
box-sizing: border-box; | ||
height: 72px; | ||
|
||
/* White Color/50 */ | ||
|
||
/* Note: backdrop-filter has minimal browser support */ | ||
border-radius: 16px; | ||
|
||
/* Inside auto layout */ | ||
|
||
padding: 12px 28px; | ||
flex: none; | ||
order: 0; | ||
flex-grow: 0; | ||
} | ||
|
||
.backgroundRow { | ||
background: var(--border-color); | ||
/* White Color/50 */ | ||
border: 1px solid var(--border-color); | ||
backdrop-filter: blur(42px); | ||
} | ||
|
||
.gradientRow { | ||
background: linear-gradient(90deg, rgba(139, 255, 98, 0.08) 0%, rgba(97, 181, 67, 0) 10.65%), | ||
rgba(255, 255, 255, 0.05); | ||
border: 1px solid var(--border-color); | ||
backdrop-filter: blur(42px); | ||
} | ||
|
||
.rowType { | ||
position: absolute; | ||
width: 4px; | ||
height: 32px; | ||
left: 0px; | ||
top: 20px; | ||
border-radius: 0px 4px 4px 0px; | ||
} | ||
|
||
.success { | ||
background: var(--alert-color-success); | ||
} | ||
|
||
.error { | ||
background: var(--alert-color-error); | ||
} |
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,37 @@ | ||
// import styles from './style.module.scss' | ||
|
||
// interface ColumeType { | ||
// dataIndex: string | ||
// key: string | ||
// } | ||
|
||
// interface Props { | ||
// dataSource: object[], | ||
// columns: ColumeType[] | ||
// } | ||
|
||
// const Table = ({ headers, rows }: Props) => { | ||
// return ( | ||
// <table className={styles.table}> | ||
// <tr> | ||
// {headers.map((header: JSX.Element | string) => ( | ||
// <th className={styles.tableHeader}>{header}</th> | ||
// ))} | ||
// </tr> | ||
// {/* {rows.map(row) => ( | ||
// <tr> | ||
// <td>Alfreds Futterkiste</td> | ||
// <td>Maria Anders</td> | ||
// <td>Germany</td> | ||
// </tr> | ||
// )} */} | ||
// <tr> | ||
// <td>Centro comercial Moctezuma</td> | ||
// <td>Francisco Chang</td> | ||
// <td>Mexico</td> | ||
// </tr> | ||
// </table> | ||
// ) | ||
// } | ||
|
||
// export default Table |
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,9 @@ | ||
.table { | ||
box-sizing: border-box; | ||
|
||
// background: var(--border-color); | ||
/* White Color/100 */ | ||
|
||
border: 1px solid var(--same-color-theme-10); | ||
border-radius: 8px; | ||
} |
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,27 @@ | ||
import clsx from 'clsx' | ||
import styles from './style.module.scss' | ||
|
||
interface Props { | ||
active: boolean | ||
title: string | ||
onClick?: any | ||
} | ||
|
||
const BorderActive = () => <div className={styles.borderActive} /> | ||
|
||
const Tab = ({ active, title, onClick }: Props) => { | ||
if (active) | ||
return ( | ||
<a onClick={onClick} className={clsx(styles.tab, styles.tabActive, 'text', 'text-base')}> | ||
<span>{title}</span> | ||
<BorderActive /> | ||
</a> | ||
) | ||
return ( | ||
<a onClick={onClick} className={clsx(styles.tab, 'text', 'text-base')}> | ||
<span>{title}</span> | ||
</a> | ||
) | ||
} | ||
|
||
export default Tab |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cần có type/option để ra nhiều kiểu hơn