-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(teleport): tabs and slippage (#1041)
- Loading branch information
1 parent
8640614
commit 28d36cf
Showing
30 changed files
with
216 additions
and
54 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 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
16 changes: 4 additions & 12 deletions
16
src/containers/teleport/components/Inputs/InputMemo/InputMemo.module.scss
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
8 changes: 8 additions & 0 deletions
8
src/containers/teleport/components/slippage/Slippage.module.scss
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,8 @@ | ||
.container { | ||
color: var(--grayscale-dark); | ||
font-size: 0.75rem; | ||
|
||
.value { | ||
color: var(--grayscale-primary); | ||
} | ||
} |
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 @@ | ||
import s from './Slippage.module.scss'; | ||
|
||
type Props = { | ||
value: number; | ||
}; | ||
|
||
function Slippage({ value }: Props) { | ||
return ( | ||
<span className={s.container}> | ||
slippage: <span className={s.value}>{value}%</span> | ||
</span> | ||
); | ||
} | ||
|
||
export default Slippage; |
5 changes: 5 additions & 0 deletions
5
src/containers/teleport/components/tabList/TabList.module.scss
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,5 @@ | ||
.wrapper { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); | ||
width: 100%; | ||
} |
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,45 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import ButtonTeleport from 'src/containers/warp/components/buttonGroup/indexBtn'; | ||
import { TypePages } from '../../type'; | ||
import s from './TabList.module.scss'; | ||
|
||
type TabListProps = { | ||
selected: TypePages; | ||
}; | ||
|
||
function TabList({ selected }: TabListProps) { | ||
const navigate = useNavigate(); | ||
|
||
const handleHistory = (to: string) => { | ||
navigate(to); | ||
}; | ||
|
||
return ( | ||
<div className={s.wrapper}> | ||
<ButtonTeleport | ||
status="left" | ||
isSelected={selected === TypePages.send} | ||
onClick={() => handleHistory(TypePages.send)} | ||
> | ||
{TypePages.send} | ||
</ButtonTeleport> | ||
<ButtonTeleport | ||
status="center" | ||
isSelected={selected === TypePages.bridge} | ||
onClick={() => handleHistory(TypePages.bridge)} | ||
> | ||
{TypePages.bridge} | ||
</ButtonTeleport> | ||
<ButtonTeleport | ||
status="right" | ||
isSelected={selected === TypePages.swap} | ||
onClick={() => handleHistory(TypePages.swap)} | ||
> | ||
{TypePages.swap} | ||
</ButtonTeleport> | ||
</div> | ||
); | ||
} | ||
|
||
export default TabList; |
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 @@ | ||
$mobile-breakpoint: 480px; | ||
|
||
.header { | ||
margin: 10px auto 30px; | ||
width: 420px; | ||
|
||
@media (width <=$mobile-breakpoint) { | ||
width: unset; | ||
|
||
>div { | ||
width: 100vw; | ||
} | ||
} | ||
} |
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,30 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { Outlet, useLocation } from 'react-router-dom'; | ||
import s from './Layout.module.scss'; | ||
import TabList from '../../components/tabList/TabList'; | ||
import { TypePages } from '../../type'; | ||
|
||
function Layout() { | ||
const location = useLocation(); | ||
const [active, setActive] = useState<TypePages | undefined>(TypePages.swap); | ||
|
||
useEffect(() => { | ||
const locationSplit = location.pathname.replace(/^\/|\/$/g, '').split('/'); | ||
setActive( | ||
Object.values(TypePages).find((item) => item === locationSplit[1]) | ||
); | ||
}, [location]); | ||
|
||
return ( | ||
<div> | ||
{active && ( | ||
<header className={s.header}> | ||
<TabList selected={active} /> | ||
</header> | ||
)} | ||
<Outlet /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Layout; |
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
5 changes: 3 additions & 2 deletions
5
src/containers/teleport/pages/mainScreen/components/SendAction/SendAction.module.scss
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,6 +1,7 @@ | ||
.container { | ||
display: flex; | ||
gap: 20px; | ||
align-items: center; | ||
justify-content: space-between; | ||
overflow: hidden; | ||
padding: 5px 0; | ||
padding: 7px 7px 7px 0px; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
src/containers/teleport/pages/mainScreen/components/SwapAction/SwapAction.module.scss
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,6 +1,6 @@ | ||
.container { | ||
display: grid; | ||
grid-template-columns: repeat(3, 1fr); | ||
row-gap: 20px; | ||
row-gap: 15px; | ||
overflow: hidden; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/containers/teleport/pages/mainScreen/components/TeleportStat/TeleportStat.module.scss
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.