Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/upload-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ name: Build and Push Docker Image

on:
push:
paths:
- packages/database/**
- packages/server/**
- packages/spec/**
branches:
- main
tags:
- v*
pull_request:
paths:
- packages/database/**
- packages/server/**
- packages/spec/**

env:
IMAGE_NAME: crest-server
Expand All @@ -20,10 +28,10 @@ jobs:

steps:
- uses: actions/checkout@v5

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

Expand All @@ -37,4 +45,4 @@ jobs:
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "packages/core/lib/boring-vault"]
path = packages/core/lib/boring-vault
url = https://github.com/Se7en-Seas/boring-vault
[submodule "packages/core/lib/solady"]
path = packages/core/lib/solady
url = https://github.com/vectorized/solady
8 changes: 8 additions & 0 deletions packages/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ module.exports = withPlugins(
compiler: {
emotion: true,
},
webpack5: true,
webpack: (config) => {
config.resolve.fallback = {
// Peer dependency import fallback for wagmi > @wagmi/connectors > @metamask/sdk
'@react-native-async-storage/async-storage': false,
};
return config;
},
},
[withBundleAnalyzer],
);
13 changes: 9 additions & 4 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,32 @@
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@rainbow-me/rainbowkit": "^2.2.8",
"@tanstack/react-query": "5.89.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.2.0",
"clsx": "^2.1.1",
"lucide-react": "^0.544.0",
"next": "^15.5.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-is": "^19.0.0",
"tailwind-merge": "^3.3.1",
"tailwindcss-animate": "^1.0.7"
"tailwindcss-animate": "^1.0.7",
"viem": "2.37.7",
"wagmi": "2.17.1"
},
"devDependencies": {
"@next/bundle-analyzer": "^15.5.3",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "^22.10.1",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@types/styled-jsx": "^3.4.4",
"autoprefixer": "^10.4.21",
"next-composed-plugins": "^2.2.1",
"next-composed-plugins": "^1.0.1",
"postcss": "^8.5.3",
"prettier": "^3.4.2",
"tailwindcss": "^3.4.15",
"typescript": "^5.6.3"
}
}
}
16 changes: 16 additions & 0 deletions packages/app/public/assets/crest-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 121 additions & 0 deletions packages/app/src/components/ConnectButton.tsx
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;
}
}
`;
92 changes: 92 additions & 0 deletions packages/app/src/components/NavigationBar.tsx
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;
`;
1 change: 1 addition & 0 deletions packages/app/src/constants/chains.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { hyperliquidEvmTestnet } from 'viem/chains';
12 changes: 12 additions & 0 deletions packages/app/src/constants/config.ts
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 added packages/app/src/fonts/Optician-Sans.otf
Binary file not shown.
13 changes: 13 additions & 0 deletions packages/app/src/fonts/index.ts
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

폰트

  • 기본값은 Instrument Sans (_app 에서 설정됨)
  • font-family: ${OpticianSans.style.fontFamily}; 이런 식으로 변경해 사용할 수 있음

Loading