-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into kyberai-ui-improvement
- Loading branch information
Showing
40 changed files
with
795 additions
and
505 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
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.
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.
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
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,58 @@ | ||
import { forwardRef } from 'react' | ||
import styled, { CSSProperties, css } from 'styled-components' | ||
|
||
const ButtonWrapper = styled.div<{ active?: boolean; separator?: boolean }>` | ||
font-size: 12px; | ||
line-height: 16px; | ||
transition: all 0.2s ease; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 40px; | ||
flex: 1; | ||
box-sizing: border-box; | ||
cursor: pointer; | ||
user-select: none; | ||
${({ theme, separator, active }) => | ||
separator && | ||
!active && | ||
css` | ||
position: relative; | ||
&::before { | ||
content: ''; | ||
position: absolute; | ||
left: 0; | ||
height: 16px; | ||
border: 1px solid ${theme.border}; | ||
} | ||
`} | ||
${({ theme, active }) => | ||
active | ||
? css` | ||
color: ${theme.primary}; | ||
background-color: ${theme.primary + '40'}; | ||
box-shadow: inset 0 -2px 0 0 ${theme.primary}; | ||
` | ||
: css` | ||
color: ${theme.subText}; | ||
background-color: ${theme.background}; | ||
`} | ||
:hover { | ||
filter: brightness(1.2); | ||
} | ||
` | ||
|
||
type Props = { text?: string; active?: boolean; onClick?: () => void; style?: CSSProperties; separator?: boolean } | ||
const TabButton = forwardRef<HTMLDivElement, Props>(function TabButton( | ||
{ text, active, onClick, style, separator }, | ||
ref, | ||
) { | ||
return ( | ||
<ButtonWrapper active={active} onClick={onClick} style={style} separator={separator} ref={ref}> | ||
{text} | ||
</ButtonWrapper> | ||
) | ||
}) | ||
|
||
export default TabButton |
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.