-
Notifications
You must be signed in to change notification settings - Fork 0
[app] Setup rainbowkit and @/fonts
#7
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6893d77
[core] Update README.md
junhoyeo b092464
[core] Add testnet USDT
junhoyeo e28a791
[core] Use `usdt0` in `CrestManager`
junhoyeo bba36c1
[core] Update deploy script
junhoyeo a021237
[core] Update deploy script to write output
junhoyeo 67c3729
[core] Add testnet deployment
junhoyeo fc597f3
[app] Setup `@rainbow-me/rainbowkit`
junhoyeo 5dd7ca8
[app] Implement `NavigationBar`
junhoyeo eb8cb24
[app] Add nav links
junhoyeo f778f22
[app] Setup `@/fonts`
junhoyeo ddbf968
[app] Add peer dependency import fallback (suppress warning) for `@me…
junhoyeo 89e2247
[app] Add `@types/styled-jsx`
junhoyeo 7a7c594
Only run `upload-image` when path under `packages/{database, server, …
junhoyeo fe50faa
Update packages/app/src/constants/config.ts
junhoyeo 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
This file contains hidden or 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,121 @@ | ||
| import styled from '@emotion/styled'; | ||
| import { ConnectButton as RainbowKitConnectButton } from '@rainbow-me/rainbowkit'; | ||
| import { WalletIcon } from 'lucide-react'; | ||
|
|
||
| import { OpticianSans } from '@/fonts'; | ||
| import { shortenAddress } from '@/utils/address'; | ||
|
|
||
| export const ConnectButton: React.FC = () => { | ||
| return ( | ||
| <RainbowKitConnectButton.Custom> | ||
| {({ | ||
| account, | ||
| chain, | ||
| openAccountModal, | ||
| openChainModal, | ||
| openConnectModal, | ||
| mounted, | ||
| }) => { | ||
| const ready = mounted; | ||
| const connected = mounted && account && chain; | ||
|
|
||
| return ( | ||
| <div | ||
| {...(!ready && { | ||
| 'aria-hidden': true, | ||
| style: { | ||
| opacity: 0, | ||
| pointerEvents: 'none', | ||
| userSelect: 'none', | ||
| }, | ||
| })} | ||
| > | ||
| {(() => { | ||
| if (!connected) { | ||
| return ( | ||
| <ConnectWalletButton onClick={openConnectModal} type="button"> | ||
| Connect Wallet | ||
| </ConnectWalletButton> | ||
| ); | ||
| } | ||
|
|
||
| // FIXME: Check styles here | ||
| if (chain.unsupported) { | ||
| return ( | ||
| <Button onClick={openChainModal} type="button"> | ||
| Wrong network | ||
| </Button> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <div style={{ display: 'flex', gap: 12 }}> | ||
| <UserButton onClick={openAccountModal} type="button"> | ||
| <WalletIcon size={14} /> | ||
|
|
||
| <span className="address"> | ||
| {shortenAddress(account.address)}{' '} | ||
| <span className="balance"> | ||
| {account.displayBalance | ||
| ? ` (${account.displayBalance})` | ||
| : ''} | ||
| </span> | ||
| </span> | ||
| </UserButton> | ||
| </div> | ||
| ); | ||
| })()} | ||
| </div> | ||
| ); | ||
| }} | ||
| </RainbowKitConnectButton.Custom> | ||
| ); | ||
| }; | ||
|
|
||
| const Button = styled.button` | ||
| width: fit-content; | ||
| display: flex; | ||
| padding: 4px 14px; | ||
| justify-content: center; | ||
| align-items: center; | ||
| gap: 10px; | ||
|
|
||
| border-radius: 8px; | ||
| background: #18edeb; | ||
|
|
||
| color: #000; | ||
| text-align: center; | ||
| font-family: ${OpticianSans.style.fontFamily}; | ||
| font-size: 20px; | ||
| font-style: normal; | ||
| font-weight: 400; | ||
| line-height: 100%; | ||
| `; | ||
| const ConnectWalletButton = styled(Button)` | ||
| padding: 4px 16px; | ||
| `; | ||
|
|
||
| const UserButton = styled(Button)` | ||
| background: #253738; | ||
| color: #fff; | ||
|
|
||
| & > svg { | ||
| color: rgba(255, 255, 255, 0.6); | ||
| } | ||
|
|
||
| & > span { | ||
| font-weight: 500; | ||
| font-size: 20px; | ||
| line-height: 1; | ||
| text-align: center; | ||
| letter-spacing: -0.04em; | ||
| } | ||
|
|
||
| span.balance { | ||
| opacity: 0.7; | ||
|
|
||
| @media (max-width: 820px) { | ||
| display: none; | ||
| } | ||
| } | ||
| `; |
This file contains hidden or 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,92 @@ | ||
| import styled from '@emotion/styled'; | ||
| import Link from 'next/link'; | ||
|
|
||
| import { OpticianSans } from '@/fonts'; | ||
|
|
||
| import { ConnectButton } from './ConnectButton'; | ||
|
|
||
| const NAVIGATION_ITEMS = [ | ||
| { title: 'Interact', href: '#interact' }, | ||
| { title: 'Composition', href: '#composition' }, | ||
| ]; | ||
|
|
||
| export const NavigationBar = () => { | ||
| const scrollToTop = () => window.scrollTo({ top: 0, behavior: 'smooth' }); | ||
|
|
||
| return ( | ||
| <Wrapper> | ||
| <Container> | ||
| <Link href="/" onClick={() => scrollToTop()}> | ||
| <Logo src="/assets/crest-logo.svg" /> | ||
| </Link> | ||
|
|
||
| <NavigationList> | ||
| {NAVIGATION_ITEMS.map((item) => ( | ||
| <Link key={item.href} href={item.href}> | ||
| <Button>{item.title}</Button> | ||
| </Link> | ||
| ))} | ||
| </NavigationList> | ||
|
|
||
| <Right> | ||
| <ConnectButton /> | ||
| </Right> | ||
| </Container> | ||
| </Wrapper> | ||
| ); | ||
| }; | ||
|
|
||
| const Wrapper = styled.div` | ||
| width: 100%; | ||
| position: fixed; | ||
| top: 0; | ||
| left: 0; | ||
| right: 0; | ||
| `; | ||
| const Container = styled.div` | ||
| margin: 0 auto; | ||
| padding: 24px 20px; | ||
|
|
||
| width: 100%; | ||
| max-width: 1200px; | ||
|
|
||
| display: flex; | ||
| align-items: center; | ||
| gap: 24px; | ||
| `; | ||
| const Logo = styled.img` | ||
| width: 124px; | ||
| height: 32px; | ||
| object-fit: contain; | ||
| `; | ||
|
|
||
| const NavigationList = styled.nav` | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 6px; | ||
| `; | ||
| const Button = styled.button` | ||
| width: fit-content; | ||
| display: flex; | ||
| padding: 4px 14px; | ||
| justify-content: center; | ||
| align-items: center; | ||
| gap: 10px; | ||
|
|
||
| border-radius: 8px; | ||
| background: #253738; | ||
|
|
||
| color: #fff; | ||
| text-align: center; | ||
| font-family: ${OpticianSans.style.fontFamily}; | ||
| font-size: 20px; | ||
| font-style: normal; | ||
| font-weight: 400; | ||
| line-height: 100%; | ||
| `; | ||
|
|
||
| const Right = styled.div` | ||
| margin-left: auto; | ||
| display: flex; | ||
| align-items: center; | ||
| `; |
This file contains hidden or 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 { hyperliquidEvmTestnet } from 'viem/chains'; |
This file contains hidden or 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 { getDefaultConfig } from '@rainbow-me/rainbowkit'; | ||
| import { http } from 'viem'; | ||
| import { hyperliquidEvmTestnet } from 'viem/chains'; | ||
|
|
||
| export const wagmiConfig = getDefaultConfig({ | ||
| appName: 'Crest', | ||
| projectId: 'e41e817bfd4e2b5c929670379c5bfa61', | ||
| chains: [hyperliquidEvmTestnet], | ||
| transports: { | ||
| [hyperliquidEvmTestnet.id]: http(), | ||
| }, | ||
| }); |
Binary file not shown.
This file contains hidden or 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 { Instrument_Sans } from 'next/font/google'; | ||
| import localFont from 'next/font/local'; | ||
|
|
||
| export const OpticianSans = localFont({ | ||
| src: './Optician-Sans.otf', | ||
| display: 'block', | ||
| fallback: ['Optician Sans', 'Inter', 'sans-serif'], | ||
| }); | ||
|
|
||
| export const InstrumentSans = Instrument_Sans({ | ||
| subsets: ['latin'], | ||
| weight: ['400', '500', '600', '700'], | ||
| }); | ||
|
Comment on lines
+4
to
+13
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 폰트
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.