diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index c58db9c6..00000000 --- a/.eslintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "root": true, - "extends": ["eslint:recommended"], - "env": { - "browser": true, - "node": true, - "es6": true, - "commonjs": true - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..f23f786d --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,24 @@ +module.exports = { + env: { + node: true, + es2021: true, + }, + extends: ["eslint:recommended"], + overrides: [ + { + env: { + node: true, + }, + files: [".eslintrc.{js,cjs}"], + parserOptions: { + sourceType: "script", + }, + }, + ], + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + }, + plugins: [], + rules: {}, +}; diff --git a/next/.eslintrc b/next/.eslintrc deleted file mode 100644 index aa40f2a3..00000000 --- a/next/.eslintrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": ["../.eslintrc", "next", "@osn"], - "env": { - "browser": true, - "node": true, - "es6": true - }, - "rules": { - "@next/next/no-img-element": "off" - } -} diff --git a/next/.eslintrc.js b/next/.eslintrc.js new file mode 100644 index 00000000..03e3f0da --- /dev/null +++ b/next/.eslintrc.js @@ -0,0 +1,12 @@ +module.exports = { + extends: ["next/core-web-vitals", "@osn", "../.eslintrc.js"], + parserOptions: { + babelOptions: { + presets: [require.resolve("next/babel")], + }, + }, + rules: { + "@next/next/no-img-element": "off", + "jsx-a11y/alt-text": "off", + }, +}; diff --git a/next/components/accordionPanel/fold/caret-down.svg b/next/components/accordionPanel/fold/caret-down.svg index 8654094d..f525ac80 100644 --- a/next/components/accordionPanel/fold/caret-down.svg +++ b/next/components/accordionPanel/fold/caret-down.svg @@ -2,7 +2,7 @@ + fill="var(--textTertiary, #A1A8B3)"/> diff --git a/next/components/accordionPanel/fold/index.js b/next/components/accordionPanel/fold/index.js index e2d422f1..4fd55890 100644 --- a/next/components/accordionPanel/fold/index.js +++ b/next/components/accordionPanel/fold/index.js @@ -10,7 +10,7 @@ const Wrapper = styled.span` transform: rotate(${(props) => (props.fold ? 180 : 0)}deg); } path { - fill: #506176; + fill: var(--textSecondary); } } `; diff --git a/next/components/accordionPanel/panel.js b/next/components/accordionPanel/panel.js index c16dc43e..99494737 100644 --- a/next/components/accordionPanel/panel.js +++ b/next/components/accordionPanel/panel.js @@ -9,7 +9,7 @@ const Header = styled.header` ${(p) => !p.secondary && css` - border-bottom: 1px solid #f0f3f8; + border-bottom: 1px solid var(--strokeBorderDefault); padding-bottom: 20px; `} diff --git a/next/components/account.js b/next/components/account.js index 23e8aeb7..9519fe41 100644 --- a/next/components/account.js +++ b/next/components/account.js @@ -1,5 +1,5 @@ import styled, { css } from "styled-components"; -import { memo, useEffect, useState } from "react"; +import { memo, useEffect, useRef, useState } from "react"; import dynamic from "next/dynamic"; import { useDispatch, useSelector } from "react-redux"; import { @@ -10,8 +10,6 @@ import { import Avatar from "./avatar"; import { p_14_medium } from "../styles/textStyles"; import { ReactComponent as UserIcon } from "../public/imgs/icons/user.svg"; -import { shadow_200 } from "../styles/globalCss"; -import { useWindowSize } from "../frontedUtils/hooks"; import ButtonPrimary from "@osn/common-ui/es/styled/Button"; import { popUpConnect, @@ -22,6 +20,7 @@ import { import { ChainIcon } from "@osn/common-ui"; import IdentityOrAddr from "@/components/identityOrAddr"; import { useMetaMaskEventHandlers } from "services/metamask"; +import { useOnClickOutside } from "frontedUtils/hooks"; const ConnectModal = dynamic(() => import("./connect"), { ssr: false, @@ -78,21 +77,18 @@ const AccountWrapper = styled.div` `; const AccountWrapperPC = styled(AccountWrapper)` - border: 1px solid #e2e8f0; + border: 1px solid var(--strokeActionDefault); :hover { - border: 1px solid #b7c0cc; + border: 1px solid var(--strokeActionActive); } ${(p) => p.show && css` - border: 1px solid #b7c0cc; + border: 1px solid var(--strokeActionActive); `} padding: 7px 15px; - @media screen and (max-width: 800px) { - display: none; - } `; const MenuWrapper = styled.div` @@ -101,9 +97,9 @@ const MenuWrapper = styled.div` position: absolute; right: 0; top: 100%; - background: #ffffff; - border: 1px solid #f0f3f8; - ${shadow_200}; + background: var(--fillBgPrimary); + border: 1px solid var(--strokeBorderDefault); + box-shadow: var(--shadowCardHover); padding: 16px; padding-bottom: 8px; z-index: 1; @@ -115,7 +111,6 @@ const MenuWrapper = styled.div` position: initial; padding-top: 0; padding-bottom: 0; - border-bottom: 20px solid white; } .connect { @@ -130,7 +125,7 @@ const MenuItem = styled.div` const MenuDivider = styled.div` height: 1px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); margin: 12px 0; `; @@ -139,31 +134,26 @@ const LogoutWrapper = styled.div` align-items: center; justify-content: space-between; ${p_14_medium}; - color: #506176; + color: var(--textSecondary); :hover { - color: #1e2134; - } -`; - -const DarkButton = styled(ButtonPrimary)` - @media screen and (max-width: 800px) { - padding: 8px 16px; - margin: auto; - width: 100%; - text-align: center; + color: var(--textPrimary); } `; function Account({ networks }) { const dispatch = useDispatch(); - const windowSize = useWindowSize(); const account = useSelector(loginAccountSelector); const showConnect = useSelector(showConnectSelector); const [pageMounted, setPageMounted] = useState(false); const address = useSelector(loginAddressSelector); const spaceSupportMultiChain = networks?.length > 1; + const menuRef = useRef(); + useOnClickOutside(menuRef, () => { + dispatch(setShowHeaderMenu(false)); + }); + useMetaMaskEventHandlers(); const showMenu = useSelector(showHeaderMenuSelector); @@ -184,24 +174,22 @@ function Account({ networks }) { dispatch(setShowHeaderMenu(false)); }; - const ConnectWalletButton = ( -
- {!account && ( - dispatch(popUpConnect())} - className="button" - > - Connect Wallet - - )} -
+ const ConnectWalletButton = !account && ( + { + dispatch(popUpConnect()); + }} + className="w-full" + > + Connect Wallet + ); const Menu = ( - e.stopPropagation()}> + e.stopPropagation()}> {/*The dark connect button For Mobile only*/} - {!account && windowSize.width <= 800 && ConnectWalletButton} + {!account && ConnectWalletButton} {/*The dark connect button For Mobile only*/} {address && ( <> @@ -237,11 +225,6 @@ function Account({ networks }) { ); - // show ConnectModal on first priority if showConnect = true - if (showConnect) { - return ; - } - // if already connected, show address on right top corner if (address && pageMounted) { return ( @@ -270,13 +253,13 @@ function Account({ networks }) { } // if no address connected, show ConnectButton on right top corner(PC only) - if (windowSize.width > 800 && !account) { - return ConnectWalletButton; - } - - // show dropdown menu (Mobile only) - if (showMenu) { - return {Menu}; + if (!account) { + return ( +
+ {ConnectWalletButton} + {showConnect && } +
+ ); } return null; diff --git a/next/components/accountItem.js b/next/components/accountItem.js index 6b740bee..617a5518 100644 --- a/next/components/accountItem.js +++ b/next/components/accountItem.js @@ -8,18 +8,17 @@ import encodeAddressByChain from "../frontedUtils/chain/addr"; const Text = styled.p` ${p_16_semibold}; - color: #1e2134; + color: var(--textPrimary); margin: 0; `; const TextMinor = styled(Text)` ${p_14_normal}; - color: #9da9bb; + color: var(--textTertiary); `; const ItemWrapper = styled.div` height: 64px; - padding: 8px 16px; display: flex; align-items: center; & > div:first-child { diff --git a/next/components/accountSelector.js b/next/components/accountSelector.js index cfc64a47..3f54bd4b 100644 --- a/next/components/accountSelector.js +++ b/next/components/accountSelector.js @@ -1,13 +1,12 @@ import React, { useEffect, useState } from "react"; import styled from "styled-components"; -import StyledDropdown from "@/components/styled/dropdown"; import AccountItem from "./accountItem"; +import { DropdownSelector } from "@osn/common-ui"; const Wrapper = styled.div``; const DropdownWrapper = styled.div` position: relative; - z-index: 9; height: 64px; `; @@ -32,18 +31,11 @@ const AccountSelector = ({ accounts, chain, onSelect = () => {} }) => { return ( - { - setSelectedIndex(value); - }} - /> - diff --git a/next/components/assetList.js b/next/components/assetList.js index dcbd229d..f55ed256 100644 --- a/next/components/assetList.js +++ b/next/components/assetList.js @@ -1,7 +1,7 @@ import styled from "styled-components"; import { p_14_medium, p_12_normal } from "../styles/textStyles"; import { ChainIcon, FlexBetween } from "@osn/common-ui"; -import Tooltip from "./tooltip"; +import { Tooltip } from "@osn/common-ui"; const Wrapper = styled.div` display: flex; @@ -34,7 +34,7 @@ const AssetIconContainer = styled.div` const DelegationText = styled.span` ${p_12_normal} - color: #A1A8B3; + color: var(--textTertiary); text-transform: capitalize; `; diff --git a/next/components/author.js b/next/components/author.js index 080d77d6..15d69485 100644 --- a/next/components/author.js +++ b/next/components/author.js @@ -7,7 +7,7 @@ import IdentityOrAddr from "@/components/identityOrAddr"; const Wrapper = styled.div` display: flex; align-items: center; - color: #2e343d; + color: var(--textPrimary); > :not(:first-child) { margin-left: 4px; } diff --git a/next/components/avatar.js b/next/components/avatar.js index 82d11d1a..31b6cf0a 100644 --- a/next/components/avatar.js +++ b/next/components/avatar.js @@ -10,7 +10,7 @@ const Wrapper = styled.span` width: ${(props) => props.size}px; height: ${(props) => props.size}px; border-radius: ${(props) => props.size / 2}px; - background: #f0f3f8; ; + background-color: var(--fillBgTertiary); ; `; const ImgWrapper = styled.img` diff --git a/next/components/chainSelector.js b/next/components/chainSelector.js index 01d8508e..5d183f99 100644 --- a/next/components/chainSelector.js +++ b/next/components/chainSelector.js @@ -11,7 +11,7 @@ const Wrapper = styled.div` const Text = styled.p` ${p_14_medium}; text-transform: capitalize; - color: #1e2134; + color: var(--textPrimary); margin: 0; `; diff --git a/next/components/connect/styled.js b/next/components/connect/styled.js index c731dd91..40b93758 100644 --- a/next/components/connect/styled.js +++ b/next/components/connect/styled.js @@ -1,5 +1,5 @@ import styled from "styled-components"; -import { Modal } from "semantic-ui-react"; +import { Modal } from "@osn/common-ui"; import { p_14_normal, p_16_semibold, @@ -23,7 +23,7 @@ export const CloseBar = styled.div` flex-direction: row-reverse; > svg path { - fill: #9da9bb; + fill: var(--textTertiary); } cursor: pointer; @@ -31,18 +31,18 @@ export const CloseBar = styled.div` export const StyledTitle = styled.header` ${p_20_semibold}; - color: #1e2134; + color: var(--textPrimary); margin-bottom: 8px; `; export const StyledText = styled.p` ${p_16_semibold}; - color: #1e2134; + color: var(--textPrimary); `; export const StyledDescription = styled.p` ${p_14_normal}; - color: #ee4444; + color: var(--textFeedbackError); `; export const ActionBar = styled.div` diff --git a/next/components/datePicker.js b/next/components/datePicker.js index b19bf6d7..e283b321 100644 --- a/next/components/datePicker.js +++ b/next/components/datePicker.js @@ -8,14 +8,13 @@ import { useOnClickOutside } from "frontedUtils/hooks"; import { ReactComponent as CaretRight } from "/public/imgs/icons/caret-right.svg"; import { ReactComponent as ArrowLeft } from "/public/imgs/icons/arrow-left.svg"; import { ReactComponent as ArrowRight } from "/public/imgs/icons/arrow-right.svg"; -import Button from "@osn/common-ui/es/styled/Button"; import { p_14_medium, p_14_normal, p_16_normal, p_16_semibold, } from "../styles/textStyles"; -import { Flex, FlexBetween } from "@osn/common-ui"; +import { Flex, FlexBetween, Button } from "@osn/common-ui"; const Wrapper = styled.div` position: relative; @@ -25,9 +24,9 @@ const DateTimeWrapper = styled.div``; const DateButton = styled.div` padding: 12px 16px; - border: 1px solid #e2e8f0; + border: 1px solid var(--strokeActionDefault); :hover { - border-color: #b7c0cc; + border-color: var(--strokeActionActive); } display: flex; cursor: pointer; @@ -35,19 +34,19 @@ const DateButton = styled.div` font-size: 14px; line-height: 24px; .placeholder { - color: #9da9bb; + color: var(--textTertiary); } > div { flex-grow: 1; } > svg { flex: 0 0 24px; - fill: #506176; + fill: var(--textSecondary); } ${(p) => p.active && css` - border-color: #b7c0cc; + border-color: var(--strokeActionActive); `} `; @@ -56,9 +55,8 @@ const DateWrapper = styled.div` z-index: 1; right: 0; padding: 24px; - background: #ffffff; - box-shadow: 0px 4px 31px rgba(26, 33, 44, 0.06), - 0px 0.751293px 8px rgba(26, 33, 44, 0.04); + background: var(--fillBgPrimary); + box-shadow: var(--shadowPopup); .react-datepicker__header { background: transparent; @@ -68,10 +66,10 @@ const DateWrapper = styled.div` .react-datepicker__day-name { width: 40px; - font-family: Inter, sans-serif; + font-family: var(--font-inter), sans-serif; ${p_14_medium}; text-align: center; - color: #506176; + color: var(--textSecondary); margin: 0 !important; } @@ -82,6 +80,7 @@ const DateWrapper = styled.div` .react-datepicker { border-radius: 0; border: none; + background: transparent; } .react-datepicker__month { @@ -91,30 +90,30 @@ const DateWrapper = styled.div` .react-datepicker__day { width: 40px; height: 40px; - font-family: Inter, sans-serif; + font-family: var(--font-inter), sans-serif; ${p_14_normal}; - color: #1e2134; + color: var(--textPrimary); display: inline-flex; align-items: center; justify-content: center; border-radius: 0; margin: 0 !important; :hover { - background: #f0f3f8; + background-color: var(--fillBgTertiary); } } .react-datepicker__day--today { font-weight: 600; - border: 1px solid #e2e8f0; + border: 1px solid var(--strokeActionDefault); } .react-datepicker__day--selected { - background: #f0f3f8; + background-color: var(--fillBgTertiary); } .react-datepicker__day--outside-month { - color: #9da9bb; + color: var(--textTertiary); } .react-datepicker__day--keyboard-selected { @@ -122,7 +121,7 @@ const DateWrapper = styled.div` } .react-datepicker__day--disabled { - color: #9da9bb; + color: var(--textTertiary); cursor: not-allowed; &:hover { background: none; @@ -132,23 +131,23 @@ const DateWrapper = styled.div` const DateHeader = styled(Flex)` > div { - font-family: Inter, sans-serif; + font-family: var(--font-inter), sans-serif; ${p_16_semibold}; text-align: center; - color: #1e2134; + color: var(--textPrimary); flex: 1 1 auto; } > svg { cursor: pointer; path { - fill: #506176; + fill: var(--textSecondary); } } `; const Divider = styled.div` height: 1px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); margin: 16px 0; `; @@ -165,9 +164,8 @@ const TimeWrapper = styled.div` position: absolute; right: 0; padding: 24px; - background: #ffffff; - box-shadow: 0px 4px 31px rgba(26, 33, 44, 0.06), - 0px 0.751293px 8px rgba(26, 33, 44, 0.04); + background: var(--fillBgPrimary); + box-shadow: var(--shadowPopup); `; const TimeHeaderWrapper = styled(FlexBetween)` @@ -175,10 +173,10 @@ const TimeHeaderWrapper = styled(FlexBetween)` white-space: nowrap; > :first-child { font-weight: 600; - color: #1e2134; + color: var(--textPrimary); } > :last-child { - color: #9da9bb; + color: var(--textTertiary); font-size: 14px; } `; @@ -188,9 +186,9 @@ const TimeInputWrapper = styled(FlexBetween)` padding: 12px 4px; width: 280px; height: 48px; - border-bottom: 1px solid #e2e8f0; + border-bottom: 1px solid var(--strokeActionDefault); ${p_14_normal}; - background: #fbfcfe; + background: var(--fillBgSecondary); `; const TimeInput = styled.input` diff --git a/next/components/datetime.js b/next/components/datetime.js index 29eb208f..bb315645 100644 --- a/next/components/datetime.js +++ b/next/components/datetime.js @@ -7,8 +7,8 @@ const Wrapper = styled.div` gap: 8px; align-items: center; padding: 12px 16px; - background: #fbfcfe; - border: 1px solid #e2e8f0; + background: var(--fillBgSecondary); + border: 1px solid var(--strokeActionDefault); ${p_14_normal}; `; diff --git a/next/components/header.js b/next/components/header.js index 3926df0d..9a67f46d 100644 --- a/next/components/header.js +++ b/next/components/header.js @@ -1,50 +1,25 @@ import styled from "styled-components"; -import { useRef } from "react"; import Link from "next/link"; -import { useOnClickOutside } from "frontedUtils/hooks"; import Account from "./account"; -import { - p_12_normal, - p_16_semibold, - p_18_semibold, -} from "../styles/textStyles"; +import { p_12_normal, p_18_semibold } from "../styles/textStyles"; import { useRouter } from "next/router"; -import { useDispatch, useSelector } from "react-redux"; -import { - setShowHeaderMenu, - showHeaderMenuSelector, -} from "../store/reducers/showConnectSlice"; import { Header as OsnHeader } from "@osn/common-ui"; -import { ReactComponent as Plus } from "../public/imgs/icons/plus.svg"; -import { ReactComponent as Discussions } from "../public/imgs/icons/discussions.svg"; -import { Flex } from "@osn/common-ui"; -import Menu from "@/components/menu"; import NotificationBell from "./notification/bell"; import { ReactComponent as CaretRight } from "/public/imgs/icons/caret-right-s.svg"; +import { SystemApps } from "@osn/icons/opensquare"; +import LogoProductVotingLight from "@osn/icons/src/opensquare/logoProductVotingLight.png"; +import LogoProductVotingDark from "@osn/icons/src/opensquare/logoProductVotingDark.png"; +import { cn } from "@osn/common-ui"; const CaretRightIcon = styled(CaretRight)` margin-left: 16px; `; -const ContentWrapper = styled.div` - width: 100%; - display: flex; - align-items: center; - justify-content: space-between; - flex-wrap: wrap; - > svg { - margin: 20px -20px; - @media screen and (min-width: 800px) { - display: none; - } - } -`; - const AppWrapper = styled.div` display: flex; align-items: center; ${p_18_semibold}; - height: 36px; + /* height: 36px; */ cursor: pointer; @@ -53,14 +28,6 @@ const AppWrapper = styled.div` display: flex; flex-wrap: wrap; } - .onHoverReverse { - transform: rotate(180deg); - } - } - - > img { - width: 24px; - margin-right: 8px; } span { @@ -80,9 +47,7 @@ const HoverMenu = styled.div` z-index: 1; top: 60px; width: 360px; - box-shadow: 0 4px 31px rgba(26, 33, 44, 0.06), - 0px 0.751293px 8px rgba(26, 33, 44, 0.04); - background: white; + background-color: var(--fillBgPrimary); `; const MenuItem = styled.a` @@ -101,106 +66,27 @@ const MenuItem = styled.a` } span { ${p_12_normal}; - color: #a1a8b3; - } -`; - -const HeaderItemWrapper = styled.div` - display: flex; - gap: 32px; - - @media screen and (max-width: 800px) { - display: flex; - align-items: center; - justify-content: center; - width: 100vw; - z-index: 1; - position: absolute; - top: 68px; - left: 0; - right: 0; - } - background-color: white; -`; - -const SecondaryHeaderItemWrapper = styled(HeaderItemWrapper)` - @media screen and (min-width: 800px) { - display: none; + color: var(--textTertiary); } `; -const IconWrapper = styled.div` - display: none; - @media screen and (max-width: 800px) { - display: flex; - cursor: pointer; - } -`; - -const ExternalLinkWrapper = styled(Flex)` - gap: 32px; - @media screen and (max-width: 800px) { - display: none; - } -`; - -const ExternalLink = styled.a` - ${p_16_semibold}; - color: #506176; - display: none; - @media screen and (min-width: 800px) { - display: flex; - } - cursor: pointer; - - svg { - margin-right: 8px; - } - - &:hover { - color: #506176; - } -`; - -const InternalLink = ExternalLink; - -const AccountAndBell = styled.div` - display: flex; - gap: 16px; -`; - export default function Header({ networks }) { - const dispatch = useDispatch(); - const showMenu = useSelector(showHeaderMenuSelector); - - const ref = useRef(); - useOnClickOutside(ref, (event) => { - // connect modal is at body level, doesn't contained in the
, so exclude manually - if (document?.querySelector(".modals")?.contains(event.target)) { - return; - } - dispatch(setShowHeaderMenu(false)); - }); const router = useRouter(); const isHomePage = router.pathname === "/"; return ( ( - - {logo} - - )} - > - + className="z-50" + prefix={ - Voting + + - + +

Off-chain Voting

@@ -218,45 +104,39 @@ export default function Header({ networks }) {
- { - dispatch(setShowHeaderMenu(!showMenu)); - }} - > - - - - {isHomePage && ( - - - - - Add a Space - - - - - Discussions - - + } + logoRender={(logo) => ( + + {logo} + + )} + links={[ + isHomePage && { + className: "max-lg:hidden max-sm:inline-block", + content: Add a Space, + }, + { + content: ( + + Discussions + + ), + }, + ].filter(Boolean)} + connectButton={ +
- - - - - {showMenu && ( - - - - )} - - + > + + +
+ } + >
); } diff --git a/next/components/input.js b/next/components/input.js index 41112e7a..a5b40383 100644 --- a/next/components/input.js +++ b/next/components/input.js @@ -4,18 +4,18 @@ import { p_14_normal } from "../styles/textStyles"; const styledInput = styled.input` all: unset; padding: 12px 16px; - background: #fbfcfe; - border-bottom: 1px solid #e2e8f0; + background: var(--fillBgSecondary); + border-bottom: 1px solid var(--strokeActionDefault); :hover, :focus, :active { - border-color: #b7c0cc; + border-color: var(--strokeActionActive); } ${p_14_normal}; display: block; - color: #1e2134; + color: var(--textPrimary); ::placeholder { - color: #9da9bb; + color: var(--textTertiary); } ::-webkit-outer-spin-button, ::-webkit-inner-spin-button { diff --git a/next/components/layout.js b/next/components/layout.js index aa8bd4bd..db007f05 100644 --- a/next/components/layout.js +++ b/next/components/layout.js @@ -13,7 +13,6 @@ import NotificationMonitor from "./notification/monitor"; const Wrapper = styled.div` min-height: 100vh; - width: 100vw; overflow: hidden; display: flex; flex-direction: column; diff --git a/next/components/listInfo/details.js b/next/components/listInfo/details.js index 478b50d1..a5a03eed 100644 --- a/next/components/listInfo/details.js +++ b/next/components/listInfo/details.js @@ -33,7 +33,7 @@ const LogoName = styled.div` const LogoSymbol = styled.div` ${p_14_normal}; - color: #a1a8b3; + color: var(--textTertiary); `; const DetailsWrapper = styled.div` @@ -62,7 +62,7 @@ const DetailsItem = styled.div` const DetailsLabel = styled.span` ${p_14_medium}; - color: #506176; + color: var(--textSecondary); `; const DetailsValue = styled(FlexBetween)` diff --git a/next/components/listInfo/index.js b/next/components/listInfo/index.js index 16b3c79f..7a4da5e1 100644 --- a/next/components/listInfo/index.js +++ b/next/components/listInfo/index.js @@ -25,7 +25,7 @@ const LogoName = styled.div` const LogoSymbol = styled.div` ${p_14_normal}; - color: #a1a8b3; + color: var(--textTertiary); `; const AboutItem = styled.div` @@ -52,25 +52,25 @@ const AboutName = styled.div` const AboutDetail = styled.div` ${p_14_normal}; - color: #a1a8b3; + color: var(--textTertiary); `; const StrategyAboutDetail = styled.span` ${p_14_normal}; - color: #a1a8b3; + color: var(--textTertiary); max-width: 240px; `; const AboutDivider = styled.div` width: 1px; height: 16px; - background: #e2e8f0; + background: var(--fillBgBrandDisable); margin: 0 40px; `; const ChainIconsWrapper = styled.div` ${p_14_normal}; - color: #a1a8b3; + color: var(--textTertiary); display: flex; `; diff --git a/next/components/listTab.js b/next/components/listTab.js index 40b0bda4..dd459cde 100644 --- a/next/components/listTab.js +++ b/next/components/listTab.js @@ -4,7 +4,7 @@ import { ReactComponent as QuestionMark } from "../public/imgs/icons/question-ma import { LIST_TAB_ITEMS } from "frontedUtils/constants"; import { p_16_semibold } from "../styles/textStyles"; import { useRouter } from "next/router"; -import Tooltip from "@/components/tooltip"; +import { Tooltip } from "@osn/common-ui"; import { Flex, FlexBetween } from "@osn/common-ui"; const Wrapper = styled(FlexBetween)` @@ -28,6 +28,9 @@ const Wrapper = styled(FlexBetween)` `; const Item = styled.div` + display: flex; + align-items: center; + gap: 4px; @media screen and (max-width: 800px) { position: relative; } @@ -41,19 +44,15 @@ const Item = styled.div` ${(p) => p.active && css` - border-bottom: 3px solid #04d2c5; + border-bottom: 3px solid var(--strokeBgBrandSecondary); padding-bottom: 17px; `} - > div:last-child { - margin-top: 4px; - margin-left: 4px; - } `; const NewPostLink = styled(Flex)` cursor: pointer; ${p_16_semibold}; - color: #04d2c5; + color: var(--textBrandSecondary); margin-left: 40px; > img { width: 24px; diff --git a/next/components/logoUploader/index.js b/next/components/logoUploader/index.js index b322c11e..ef994a93 100644 --- a/next/components/logoUploader/index.js +++ b/next/components/logoUploader/index.js @@ -13,9 +13,9 @@ const Wrapper = styled.div` left: 0px; top: 0px; - background: #fbfcfe; + background: var(--fillBgSecondary); - border: 1px solid #e2e8f0; + border: 1px solid var(--strokeActionDefault); border-radius: 50%; overflow: hidden; `; diff --git a/next/components/logoUploader/upload.svg b/next/components/logoUploader/upload.svg index ecbe2e8c..f1457514 100644 --- a/next/components/logoUploader/upload.svg +++ b/next/components/logoUploader/upload.svg @@ -1,6 +1,6 @@ - + diff --git a/next/components/main.js b/next/components/main.js index 0c089e6c..addb68e3 100644 --- a/next/components/main.js +++ b/next/components/main.js @@ -15,8 +15,8 @@ const Background = styled.div` top: 0; width: 100%; height: ${(p) => p.bgHeight}; - background: #ffffff; - border-bottom: 1px solid #f0f3f8; + background: var(--fillBgPrimary); + border-bottom: 1px solid var(--strokeBorderDefault); `; const ChildrenWrapper = styled.div` diff --git a/next/components/menu.js b/next/components/menu.js index 235cd3d3..295e7e71 100644 --- a/next/components/menu.js +++ b/next/components/menu.js @@ -1,6 +1,5 @@ import React from "react"; import styled from "styled-components"; -import { shadow_200 } from "../styles/globalCss"; import { useSelector } from "react-redux"; import { showHeaderMenuSelector } from "../store/reducers/showConnectSlice"; import { p_14_medium } from "../styles/textStyles"; @@ -13,9 +12,9 @@ const MenuWrapper = styled.div` position: absolute; right: 0; top: 100%; - background: #ffffff; - border: 1px solid #f0f3f8; - ${shadow_200}; + background: var(--fillBgPrimary); + border: 1px solid var(--strokeBorderDefault); + box-shadow: var(--shadowCardHover); padding: 20px; padding-bottom: 8px; z-index: 1; @@ -27,7 +26,6 @@ const MenuWrapper = styled.div` position: initial; padding-top: 0; padding-bottom: 0; - border-bottom: 20px solid white; } `; @@ -41,10 +39,10 @@ const ItemWrapper = styled.a` align-items: center; justify-content: space-between; ${p_14_medium}; - color: #506176; + color: var(--textSecondary); :hover { - color: #1e2134; + color: var(--textPrimary); } `; diff --git a/next/components/multiSelect/checked.svg b/next/components/multiSelect/checked.svg index 15945fdc..98e9c89b 100644 --- a/next/components/multiSelect/checked.svg +++ b/next/components/multiSelect/checked.svg @@ -1,4 +1,4 @@ - + diff --git a/next/components/multiSelect/drop.svg b/next/components/multiSelect/drop.svg index d6c4148f..2a826da5 100644 --- a/next/components/multiSelect/drop.svg +++ b/next/components/multiSelect/drop.svg @@ -1,6 +1,6 @@ - + diff --git a/next/components/multiSelect/dropdownList.js b/next/components/multiSelect/dropdownList.js index 2088e423..556732ec 100644 --- a/next/components/multiSelect/dropdownList.js +++ b/next/components/multiSelect/dropdownList.js @@ -10,10 +10,9 @@ const Wrapper = styled.div` align-items: flex-start; padding: 8px 0px; - background: #ffffff; + background: var(--fillBgPrimary); - box-shadow: 0px 4px 31px rgba(26, 33, 44, 0.06), - 0px 0.751293px 8px rgba(26, 33, 44, 0.04); + box-shadow: var(--shadowCardDefault); `; export default function DropdownList({ diff --git a/next/components/multiSelect/dropdownOption.js b/next/components/multiSelect/dropdownOption.js index 18e2e2ed..680d58fa 100644 --- a/next/components/multiSelect/dropdownOption.js +++ b/next/components/multiSelect/dropdownOption.js @@ -9,7 +9,7 @@ const Wrapper = styled.div` width: 100%; :hover { - background: #f0f3f8; + background-color: var(--fillBgTertiary); } `; diff --git a/next/components/multiSelect/selectedItems.js b/next/components/multiSelect/selectedItems.js index 61133e49..2feb08e5 100644 --- a/next/components/multiSelect/selectedItems.js +++ b/next/components/multiSelect/selectedItems.js @@ -7,8 +7,8 @@ const Wrapper = styled.div` align-items: center; justify-content: space-between; padding: 12px 16px; - background: #ffffff; - border: 1px solid #b7c0cc; + background: var(--fillBgPrimary); + border: 1px solid var(--strokeActionActive); gap: 8px; `; @@ -22,7 +22,7 @@ const Text = styled.span` font-weight: 500; font-size: 14px; line-height: 24px; - color: #1e2134; + color: var(--textPrimary); `; const DropIcon = styled.div` diff --git a/next/components/multiSelect/unchecked.svg b/next/components/multiSelect/unchecked.svg index 05e9acc2..d873df12 100644 --- a/next/components/multiSelect/unchecked.svg +++ b/next/components/multiSelect/unchecked.svg @@ -1,3 +1,3 @@ - + diff --git a/next/components/newSpace/backButton/back.svg b/next/components/newSpace/backButton/back.svg index 7e098c2c..fd6a1799 100644 --- a/next/components/newSpace/backButton/back.svg +++ b/next/components/newSpace/backButton/back.svg @@ -1,6 +1,6 @@ - + diff --git a/next/components/newSpace/sider/assets.js b/next/components/newSpace/sider/assets.js index 4bc70801..00c6912d 100644 --- a/next/components/newSpace/sider/assets.js +++ b/next/components/newSpace/sider/assets.js @@ -1,7 +1,7 @@ import styled from "styled-components"; import { Name, Value } from "./styled"; import { ChainIcon } from "@osn/common-ui"; -import Tooltip from "@/components/tooltip"; +import { Tooltip } from "@osn/common-ui"; const Wrapper = styled.div` display: flex; @@ -23,7 +23,7 @@ const Description = styled.div` font-size: 14px; line-height: 24px; - color: #1e2134; + color: var(--textPrimary); `; const Threshold = styled.span` @@ -32,7 +32,7 @@ const Threshold = styled.span` font-size: 14px; line-height: 24px; - color: #1e2134; + color: var(--textPrimary); `; export default function Assets({ assets = [] }) { diff --git a/next/components/newSpace/sider/index.js b/next/components/newSpace/sider/index.js index e0ea6c90..0ce0643b 100644 --- a/next/components/newSpace/sider/index.js +++ b/next/components/newSpace/sider/index.js @@ -27,7 +27,7 @@ const SpaceName = styled.span` font-size: 18px; line-height: 24px; text-align: center; - color: #1e2134; + color: var(--textPrimary); `; const TokenSymbol = styled.span` @@ -36,7 +36,7 @@ const TokenSymbol = styled.span` font-size: 14px; line-height: 24px; text-align: center; - color: #a1a8b3; + color: var(--textTertiary); `; const FlexColumn = styled.div` diff --git a/next/components/newSpace/sider/logo.js b/next/components/newSpace/sider/logo.js index 58534663..b3c6495a 100644 --- a/next/components/newSpace/sider/logo.js +++ b/next/components/newSpace/sider/logo.js @@ -4,9 +4,9 @@ const Wrapper = styled.div` width: 64px; height: 64px; - border: 1px solid #e2e8f0; + border: 1px solid var(--strokeActionDefault); border-radius: 50%; - background: #fbfcfe; + background: var(--fillBgSecondary); overflow: hidden; `; diff --git a/next/components/newSpace/sider/strategies.js b/next/components/newSpace/sider/strategies.js index 27ca92d4..ec75d76a 100644 --- a/next/components/newSpace/sider/strategies.js +++ b/next/components/newSpace/sider/strategies.js @@ -12,7 +12,7 @@ const Text = styled.span` font-weight: 500; font-size: 14px; line-height: 24px; - color: #1e2134; + color: var(--textPrimary); `; const Items = styled.div` diff --git a/next/components/newSpace/sider/styled.js b/next/components/newSpace/sider/styled.js index cbbe5141..e5b1008f 100644 --- a/next/components/newSpace/sider/styled.js +++ b/next/components/newSpace/sider/styled.js @@ -5,7 +5,7 @@ export const Name = styled.span` font-weight: 500; font-size: 14px; line-height: 24px; - color: #506176; + color: var(--textSecondary); `; export const Value = styled.div` @@ -13,5 +13,5 @@ export const Value = styled.div` font-weight: 500; font-size: 14px; line-height: 24px; - color: #a1a8b3; + color: var(--textTertiary); `; diff --git a/next/components/newSpace/step2/asset/assetConfig.js b/next/components/newSpace/step2/asset/assetConfig.js index 2b283758..160df185 100644 --- a/next/components/newSpace/step2/asset/assetConfig.js +++ b/next/components/newSpace/step2/asset/assetConfig.js @@ -1,7 +1,7 @@ import styled, { css } from "styled-components"; import { Flex, Input } from "@osn/common-ui"; import { FieldWrapper, Title } from "./styled"; -import Tooltip from "@/components/tooltip"; +import { Tooltip } from "@osn/common-ui"; const Wrapper = styled.div` display: flex; @@ -17,7 +17,7 @@ const MyFieldWrapper = styled(FieldWrapper)` ${({ disabled }) => disabled && css` - background: #f0f3f8; + background-color: var(--fillBgTertiary); `} } `; diff --git a/next/components/newSpace/step2/asset/assetDetail.js b/next/components/newSpace/step2/asset/assetDetail.js index 5e1bdc6e..fb38fee9 100644 --- a/next/components/newSpace/step2/asset/assetDetail.js +++ b/next/components/newSpace/step2/asset/assetDetail.js @@ -10,7 +10,7 @@ const Wrapper = styled.div` > * { flex-grow: 1; > div { - background: #f0f3f8; + background-color: var(--fillBgTertiary); } } `; diff --git a/next/components/newSpace/step2/asset/index.js b/next/components/newSpace/step2/asset/index.js index a3553f56..1f3caf02 100644 --- a/next/components/newSpace/step2/asset/index.js +++ b/next/components/newSpace/step2/asset/index.js @@ -24,7 +24,7 @@ const DeleteWrapper = styled.div` font-weight: 500; font-size: 14px; line-height: 24px; - color: #ee4444; + color: var(--textFeedbackError); `; const MyFieldWrapper = styled(FieldWrapper)` diff --git a/next/components/newSpace/step2/asset/styled.js b/next/components/newSpace/step2/asset/styled.js index 0251089f..0abf4682 100644 --- a/next/components/newSpace/step2/asset/styled.js +++ b/next/components/newSpace/step2/asset/styled.js @@ -7,13 +7,13 @@ export const FieldWrapper = styled.div` `; export const Title = styled.span` - font-family: "Inter"; + font-family: var(--font-inter); font-style: normal; font-weight: 600; font-size: 16px; line-height: 24px; - color: #1e2134; + color: var(--textPrimary); `; export const Wrapper = styled.div` diff --git a/next/components/newSpace/step2/newAssetButton/add.svg b/next/components/newSpace/step2/newAssetButton/add.svg index 7b3b2714..d7b68ad0 100644 --- a/next/components/newSpace/step2/newAssetButton/add.svg +++ b/next/components/newSpace/step2/newAssetButton/add.svg @@ -1,6 +1,6 @@ - + diff --git a/next/components/newSpace/step2/newAssetButton/index.js b/next/components/newSpace/step2/newAssetButton/index.js index bbb75a19..7748d588 100644 --- a/next/components/newSpace/step2/newAssetButton/index.js +++ b/next/components/newSpace/step2/newAssetButton/index.js @@ -13,7 +13,7 @@ const Text = styled.span` font-weight: 600; font-size: 16px; line-height: 24px; - color: #04d2c5; + color: var(--textBrandSecondary); `; export default function NewAssetButton({ onClick = noop }) { diff --git a/next/components/newSpace/step3/proposalThreshold.js b/next/components/newSpace/step3/proposalThreshold.js index 73cb96e6..426820ae 100644 --- a/next/components/newSpace/step3/proposalThreshold.js +++ b/next/components/newSpace/step3/proposalThreshold.js @@ -1,7 +1,7 @@ import styled from "styled-components"; import { SectionTitle } from "../styled"; import { Flex, Input } from "@osn/common-ui"; -import Tooltip from "@/components/tooltip"; +import { Tooltip } from "@osn/common-ui"; const Wrapper = styled.div` display: flex; diff --git a/next/components/newSpace/styled.js b/next/components/newSpace/styled.js index 957f236a..d2126d8d 100644 --- a/next/components/newSpace/styled.js +++ b/next/components/newSpace/styled.js @@ -6,7 +6,7 @@ export const SectionTitle = styled.span` font-weight: 600; font-size: 16px; line-height: 24px; - color: #1e2134; + color: var(--textPrimary); margin-bottom: 16px; `; @@ -15,7 +15,7 @@ export const Hint = styled.div` font-weight: 400; font-size: 14px; line-height: 24px; - color: #a1a8b3; + color: var(--textTertiary); > * { &::before { diff --git a/next/components/notification/bell.js b/next/components/notification/bell.js index c32a6315..d6984fc7 100644 --- a/next/components/notification/bell.js +++ b/next/components/notification/bell.js @@ -1,27 +1,12 @@ -import styled from "styled-components"; import Link from "next/link"; import { useSelector } from "react-redux"; import { unreadSelector } from "store/reducers/notificationSlice"; -import { FlexCenter } from "@osn/common-ui"; -import { ReactComponent as NotificationSVG } from "./notification.svg"; -import { ReactComponent as UnreadNotificationSVG } from "./unread-notification.svg"; import { loginAddressSelector } from "store/reducers/accountSlice"; - -const Wrapper = styled(FlexCenter)` - width: 38px; - height: 38px; - border: 1px solid #e2e8f0; - - &:hover { - border-color: #b7c0cc; - } - - cursor: pointer; - - @media screen and (max-width: 800px) { - display: none; - } -`; +import { Button } from "@osn/common-ui"; +import { + SystemNotification, + SystemNotificationActive, +} from "@osn/icons/opensquare"; export default function NotificationBell() { const address = useSelector(loginAddressSelector); @@ -32,10 +17,17 @@ export default function NotificationBell() { } return ( - - - {unread ? : } - - + + + {unread ? ( + + ) : ( + + )} + Notification + + + ); } diff --git a/next/components/notification/listLoader.js b/next/components/notification/listLoader.js deleted file mode 100644 index df2417c4..00000000 --- a/next/components/notification/listLoader.js +++ /dev/null @@ -1,63 +0,0 @@ -import React from "react"; -import { useWindowSize } from "frontedUtils/hooks"; -import ContentLoader from "react-content-loader"; -import styled from "styled-components"; - -const LoaderWrapper = styled.div` - svg { - background: white; - box-shadow: 0 4px 31px rgba(26, 33, 44, 0.04), - 0 0.751293px 3.88168px rgba(26, 33, 44, 0.03); - margin-bottom: 15px; - } -`; - -const MyLoader = (props) => { - const windowSize = useWindowSize(); - const padding = windowSize.width > 900 ? 64 : 32; - const loaderWidth = - windowSize.width > 1144 ? 1080 : windowSize.width - padding; - - if (isNaN(loaderWidth)) { - return null; - } - return ( - - - - ); -}; - -const ListLoader = ({ style = {} }) => { - return ( - - - - - - - - - - - - - ); -}; - -export default ListLoader; diff --git a/next/components/notification/notification.svg b/next/components/notification/notification.svg deleted file mode 100644 index b46a88f7..00000000 --- a/next/components/notification/notification.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/next/components/notification/notificationItem.js b/next/components/notification/notificationItem.js index d1d8b733..2559c897 100644 --- a/next/components/notification/notificationItem.js +++ b/next/components/notification/notificationItem.js @@ -34,10 +34,9 @@ const Head = styled(Flex)` padding: 24px; gap: 24px; - background: #ffffff; - border: 1px solid #f0f3f8; - box-shadow: 0px 4px 31px rgba(26, 33, 44, 0.04), - 0px 0.751293px 3.88168px rgba(26, 33, 44, 0.03); + background: var(--fillBgPrimary); + border: 1px solid var(--strokeBorderDefault); + box-shadow: var(--shadowCardDefault); @media screen and (max-width: ${MOBILE_SIZE}px) { display: block; diff --git a/next/components/notification/notificationTabs.js b/next/components/notification/notificationTabs.js index cfab4f69..27924053 100644 --- a/next/components/notification/notificationTabs.js +++ b/next/components/notification/notificationTabs.js @@ -1,12 +1,12 @@ // copied from qa import styled from "styled-components"; -import { Tabs, Container } from "@osn/common-ui"; +import { Tabs } from "@osn/common-ui"; import { MOBILE_SIZE } from "@osn/constants"; import { netural_grey_200 } from "@osn/common-ui/es/styles/colors"; const TabsWrapper = styled.div` - background-color: #fff; + background-color: var(--fillBgPrimary); padding-top: 40px; border-bottom: 1px solid ${netural_grey_200}; @media screen and (max-width: ${MOBILE_SIZE}px) { @@ -20,9 +20,7 @@ const TabsWrapper = styled.div` export default function NotificationTabs({ items, extra, value, setValue }) { return ( - - - + ); } diff --git a/next/components/notification/unread-notification.svg b/next/components/notification/unread-notification.svg deleted file mode 100644 index 6351add2..00000000 --- a/next/components/notification/unread-notification.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/next/components/option.js b/next/components/option.js index a815c8a4..832b7eb7 100644 --- a/next/components/option.js +++ b/next/components/option.js @@ -1,44 +1,24 @@ -import styled from "styled-components"; -import { Button as OsnButton, Flex } from "@osn/common-ui"; -import { css } from "styled-components"; -import { p_14_medium } from "@osn/common-ui/es/styles/textStyles"; -import { - primary_purple_500, - text_dark_accessory, -} from "@osn/common-ui/es/styles/colors"; - -const Button = styled(OsnButton)` - padding: 12px 24px; - ${(p) => - p.active && - css` - border-color: ${primary_purple_500} !important; - color: ${primary_purple_500}; - `} -`; - -const Content = styled(Flex)` - flex-grow: 1; - ${p_14_medium}; - position: relative; - justify-content: center; - padding: 0 48px; - ${(p) => css` - ::before { - position: absolute; - left: 0; - content: "#${p.index}"; - color: ${p.active ? primary_purple_500 : text_dark_accessory}; - } - `} -`; +import { Button, cn } from "@osn/common-ui"; function Option({ children, index, active, ...props }) { return ( - ); } diff --git a/next/components/popup/index.js b/next/components/popup/index.js index f9fc76bb..721fc059 100644 --- a/next/components/popup/index.js +++ b/next/components/popup/index.js @@ -18,13 +18,13 @@ const PopupWrapper = styled.div` const Pop = styled.div` position: relative; - background: #ffffff; + background: var(--fillBgPrimary); max-width: 320px; min-width: ${(p) => (p.noMinWidth ? "none" : "120px")}; padding: 16px; font-size: 12px; line-height: 16px; - color: #ffffff; + color: var(--textPrimaryContrast); word-wrap: break-word; text-align: left; `; @@ -35,7 +35,7 @@ const Triangle = styled.div` height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; - border-top: 6px solid #ffffff; + border-top: 6px solid var(--fillBgPrimary); left: 50%; top: 100%; transform: translateX(-50%); @@ -49,15 +49,13 @@ const ChildrenWrapper = styled.div` display: flex; } } - filter: drop-shadow(0px 4px 31px rgba(26, 33, 44, 0.06)) - drop-shadow(0px 0.751293px 8px rgba(26, 33, 44, 0.04)); `; const TitleWrapper = styled.div` font-weight: bold; font-size: 12px; line-height: 16px; - color: #ffffff; + color: var(--textPrimary); white-space: nowrap; `; @@ -67,7 +65,7 @@ export default function Popup({ content, children, title, noMinWidth }) { {children} {content && ( - + {title && {title}} {content} diff --git a/next/components/post.js b/next/components/post.js index d498b8e6..56222f83 100644 --- a/next/components/post.js +++ b/next/components/post.js @@ -4,7 +4,6 @@ import Author from "./author"; import InternalLink from "components/internalLink"; import HardLink from "components/hardLink"; import { p_16_semibold } from "styles/textStyles"; -import { shadow_100, shadow_200 } from "styles/globalCss"; import StatusTag from "./statusTag"; import PostTime from "./postTime"; import { p_24 } from "../styles/paddings"; @@ -17,15 +16,15 @@ import { p_14_medium } from "../styles/componentCss"; import { getSpaceIconUrl } from "frontedUtils/space"; const Wrapper = styled.div` - background: #ffffff; - border: 1px solid #f0f3f8; - ${shadow_100} + background: var(--fillBgPrimary); + border: 1px solid var(--strokeBorderDefault); + box-shadow: var(--shadowCardDefault); ${p_24}; :hover { - border-color: #e2e8f0; + border-color: var(--strokeActionDefault); - ${shadow_200} + box-shadow: var(--shadowCardHover); .icon > svg { display: block; } @@ -33,7 +32,7 @@ const Wrapper = styled.div` `; const Title = styled.h3` - font-family: Inter, serif; + font-family: var(--font-inter), serif; font-style: normal; display: inline-block; ${p_16_semibold}; @@ -42,7 +41,7 @@ const Title = styled.h3` const Divider = styled.div` height: 1px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); margin: 16px 0; `; @@ -52,7 +51,7 @@ const InfoWrapper = styled(FlexBetween)` const LeftWrapper = styled(Flex)` line-height: 24px; - color: #a1a8b3; + color: var(--textTertiary); flex-wrap: wrap; > :not(:first-child)::before { @@ -71,7 +70,7 @@ const SpaceName = styled.a` text-transform: capitalize; margin-left: 6px; ${p_14_medium}; - color: #1e2134 !important; + color: var(--textPrimary) !important; :hover { text-decoration-line: underline; diff --git a/next/components/postAddress.js b/next/components/postAddress.js index 4c6bb0eb..9a917a69 100644 --- a/next/components/postAddress.js +++ b/next/components/postAddress.js @@ -34,7 +34,7 @@ const FETCH_BALANCE_ERROR = const Wrapper = styled.div` padding: 20px; - background: #fbfcfe; + background: var(--fillBgSecondary); ${(p) => p.size === "small" && css` @@ -77,15 +77,15 @@ const InputWrapper = styled.div` const Input = styled.input` all: unset; - background-color: #ffffff; - border: 1px solid #e2e8f0; + background-color: var(--fillBgPrimary); + border: 1px solid var(--strokeActionDefault); padding: 23px 47px 23px 71px; ${p_14_normal}; ::placeholder { - color: #a1a8b3; + color: var(--textTertiary); } :focus { - border-color: #b7c0cc; + border-color: var(--strokeActionActive); } ${(p) => p.isLoading && @@ -105,8 +105,8 @@ const Input = styled.input` const ItemWrapper = styled(Flex)` padding: 11px 15px; - border: 1px solid #e2e8f0; - background: #ffffff; + border: 1px solid var(--strokeActionDefault); + background: var(--fillBgPrimary); cursor: pointer; overflow: hidden; text-overflow: ellipsis; @@ -131,7 +131,7 @@ const DetailWrapper = styled.div` > :last-child { font-size: 14px; line-height: 24px; - color: #506176; + color: var(--textSecondary); } ${(p) => p.size === "small" && diff --git a/next/components/postCreate/BalanceRow.js b/next/components/postCreate/BalanceRow.js index 1b06e052..5be8776e 100644 --- a/next/components/postCreate/BalanceRow.js +++ b/next/components/postCreate/BalanceRow.js @@ -1,6 +1,6 @@ import { ReactComponent as Loading } from "../../public/imgs/icons/loading.svg"; import Row from "@/components/row"; -import Tooltip from "@/components/tooltip"; +import { Tooltip } from "@osn/common-ui"; import { bigNumber2LocaleWithAbbr, toPrecision } from "../../frontedUtils"; import { memo } from "react"; import BigNumber from "bignumber.js"; diff --git a/next/components/postCreate/choice.js b/next/components/postCreate/choice.js index 4102d4e6..70da83fa 100644 --- a/next/components/postCreate/choice.js +++ b/next/components/postCreate/choice.js @@ -7,15 +7,15 @@ import { FlexBetween } from "@osn/common-ui"; const Wrapper = styled(FlexBetween)` padding: 12px 24px; - border: 1px solid #e2e8f0; + border: 1px solid var(--strokeActionDefault); ${p_14_medium}; :hover { - border-color: #b7c0cc; + border-color: var(--strokeActionActive); } ${(p) => p.focus && css` - border-color: #b7c0cc; + border-color: var(--strokeActionActive); `} `; @@ -26,7 +26,7 @@ const Input = styled.input` min-width: 0; text-align: center; ${p_14_medium}; - color: #1e2134; + color: var(--textPrimary); `; const SubstractButtonWrapper = styled.div` @@ -37,9 +37,9 @@ const SubstractButtonWrapper = styled.div` const SubstractButton = styled(Substract)` flex: 0 0 auto; cursor: pointer; - fill: #9da9bb; + fill: var(--textTertiary); :hover { - fill: #2e343d; + fill: var(--textPrimary); } `; diff --git a/next/components/postCreate/choices.js b/next/components/postCreate/choices.js index e2c2c75c..8502124f 100644 --- a/next/components/postCreate/choices.js +++ b/next/components/postCreate/choices.js @@ -5,10 +5,9 @@ import { Button } from "@osn/common-ui"; import { p_16_semibold } from "../../styles/textStyles"; const Wrapper = styled.div` - background: #ffffff; - border: 1px solid #f0f3f8; - box-shadow: 0px 4px 31px rgba(26, 33, 44, 0.04), - 0px 0.751293px 3.88168px rgba(26, 33, 44, 0.03); + background: var(--fillBgPrimary); + border: 1px solid var(--strokeBorderDefault); + box-shadow: var(--shadowCardDefault); padding: 32px; @media screen and (max-width: 800px) { padding: 20px; diff --git a/next/components/postCreate/content.js b/next/components/postCreate/content.js index 6ca64622..b7fd1655 100644 --- a/next/components/postCreate/content.js +++ b/next/components/postCreate/content.js @@ -5,10 +5,9 @@ import ToggleText from "@/components/uploadBanner/toggleText"; import Uploader from "@/components/uploadBanner/uploader"; const Wrapper = styled.div` - background: #ffffff; - border: 1px solid #f0f3f8; - box-shadow: 0px 4px 31px rgba(26, 33, 44, 0.04), - 0px 0.751293px 3.88168px rgba(26, 33, 44, 0.03); + background: var(--fillBgPrimary); + border: 1px solid var(--strokeBorderDefault); + box-shadow: var(--shadowCardDefault); padding: 32px; @media screen and (max-width: 800px) { padding: 20px; diff --git a/next/components/postCreate/information.js b/next/components/postCreate/information.js index 1c842a0e..f32f34fb 100644 --- a/next/components/postCreate/information.js +++ b/next/components/postCreate/information.js @@ -22,7 +22,7 @@ import BalanceRow from "@/components/postCreate/BalanceRow"; const Hint = styled.div` margin-top: 4px !important; - color: #ee4444; + color: var(--textFeedbackError); `; const ProxyVoteWrapper = styled.div` diff --git a/next/components/postCreate/more.js b/next/components/postCreate/more.js index a42f042a..b08bd789 100644 --- a/next/components/postCreate/more.js +++ b/next/components/postCreate/more.js @@ -22,10 +22,9 @@ import DropdownSelector from "@osn/common-ui/es/DropdownSelector"; const Wrapper = styled.div` min-width: 302px; - background: #ffffff; - border: 1px solid #f0f3f8; - box-shadow: 0px 4px 31px rgba(26, 33, 44, 0.04), - 0px 0.751293px 3.88168px rgba(26, 33, 44, 0.03); + background: var(--fillBgPrimary); + border: 1px solid var(--strokeBorderDefault); + box-shadow: var(--shadowCardDefault); padding: 32px; @media screen and (max-width: 800px) { padding: 20px; @@ -58,7 +57,7 @@ const DateWrapper = styled.div` const Divider = styled.div` height: 1px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); `; const Snapshot = styled(FlexBetween)` @@ -67,12 +66,12 @@ const Snapshot = styled(FlexBetween)` const NetworkName = styled.div` ${p_14_medium}; - color: #506176; + color: var(--textSecondary); text-transform: capitalize; `; const TextGrey = styled.span` - color: #a1a8b3; + color: var(--textTertiary); `; const ChoiceWrapper = styled.div` @@ -80,7 +79,7 @@ const ChoiceWrapper = styled.div` font-weight: 500; font-size: 14px; line-height: 24px; - color: #1e2134; + color: var(--textPrimary); `; export default function More({ onPublish, space }) { diff --git a/next/components/postDetail/appendants.js b/next/components/postDetail/appendants.js index ff61078c..0e00623f 100644 --- a/next/components/postDetail/appendants.js +++ b/next/components/postDetail/appendants.js @@ -50,7 +50,7 @@ const StyledDividerWrapper = styled(DividerWrapper)` font-weight: 500; } > :nth-child(2) { - color: #a1a8b3; + color: var(--textTertiary); } `; @@ -71,7 +71,7 @@ const AddButton = styled(FlexCenter)` const EditorWrapper = styled.div``; const Count = styled.div` - color: #a1a8b3; + color: var(--textTertiary); `; const MarkdownPreviewWrapper = styled.div` diff --git a/next/components/postDetail/biasedVotingItem.js b/next/components/postDetail/biasedVotingItem.js index 8f20560a..bdcc4144 100644 --- a/next/components/postDetail/biasedVotingItem.js +++ b/next/components/postDetail/biasedVotingItem.js @@ -1,5 +1,5 @@ import styled from "styled-components"; -import Tooltip from "../tooltip"; +import { Tooltip } from "@osn/common-ui"; import ValueDisplay from "../valueDisplay"; const Wrapper = styled.div` @@ -10,7 +10,7 @@ const Wrapper = styled.div` `; const LabelWrapper = styled.div` - color: #506176; + color: var(--textSecondary); position: relative; display: flex; max-width: 55%; diff --git a/next/components/postDetail/delegationInfo.js b/next/components/postDetail/delegationInfo.js index ac2a854d..6a1dc8be 100644 --- a/next/components/postDetail/delegationInfo.js +++ b/next/components/postDetail/delegationInfo.js @@ -11,7 +11,7 @@ const Wrapper = styled.div` font-size: 14px; line-height: 24px; - color: #506176; + color: var(--textSecondary); `; export default function DelegationInfo({ delegatee, network }) { diff --git a/next/components/postDetail/numberHeader.js b/next/components/postDetail/numberHeader.js index d7e15519..31ab4b00 100644 --- a/next/components/postDetail/numberHeader.js +++ b/next/components/postDetail/numberHeader.js @@ -2,7 +2,6 @@ import styled from "styled-components"; import { memo } from "react"; const Wrapper = styled.h3` - font-family: Inter; font-style: normal; font-weight: 600; font-size: 16px; @@ -11,7 +10,7 @@ const Wrapper = styled.h3` span { margin-left: 4px; - color: #a1a8b3; + color: var(--textTertiary); font-weight: 500; } `; diff --git a/next/components/postDetail/panel.js b/next/components/postDetail/panel.js index 3542501d..004b6269 100644 --- a/next/components/postDetail/panel.js +++ b/next/components/postDetail/panel.js @@ -2,10 +2,9 @@ import styled from "styled-components"; const Panel = styled.div` padding: 32px; - background: #ffffff; - border: 1px solid #f0f3f8; - box-shadow: 0px 4px 31px rgba(26, 33, 44, 0.04), - 0px 0.751293px 3.88168px rgba(26, 33, 44, 0.03); + background: var(--fillBgPrimary); + border: 1px solid var(--strokeBorderDefault); + box-shadow: var(--shadowCardDefault); @media screen and (max-width: 800px) { padding: 20px; margin: 0 -20px; diff --git a/next/components/postDetail/postContent.js b/next/components/postDetail/postContent.js index b14af15c..faaa37fd 100644 --- a/next/components/postDetail/postContent.js +++ b/next/components/postDetail/postContent.js @@ -35,7 +35,7 @@ const LeftWrapper = styled.div` display: flex; align-items: center; line-height: 24px; - color: #a1a8b3; + color: var(--textTertiary); flex-wrap: wrap; > :not(:first-child)::before { content: "·"; @@ -45,7 +45,7 @@ const LeftWrapper = styled.div` const Divider = styled.div` height: 1px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); margin: 20px 0; ${(p) => p.margin && @@ -56,7 +56,7 @@ const Divider = styled.div` const Content = styled.div` ${p_14_normal}; - color: #1e2134; + color: var(--textPrimary); `; export default function PostContent({ data, space }) { diff --git a/next/components/postDetail/postDiscussion.js b/next/components/postDetail/postDiscussion.js index ddceffd4..ab914b35 100644 --- a/next/components/postDetail/postDiscussion.js +++ b/next/components/postDetail/postDiscussion.js @@ -1,4 +1,4 @@ -import styled, { css } from "styled-components"; +import styled from "styled-components"; import { useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { useRouter } from "next/router"; @@ -15,7 +15,6 @@ import { removeToast, } from "store/reducers/toastSlice"; import { timeDuration } from "frontedUtils"; -import ExternalLink from "@osn/common-ui/es/ExternalLink"; import { findNetworkConfig } from "services/util"; import HeaderWithNumber from "@/components/postDetail/numberHeader"; import encodeAddressByChain from "../../frontedUtils/chain/addr"; @@ -27,7 +26,7 @@ import { MarkdownPreviewer, renderMentionIdentityUserPlugin, } from "@osn/previewer"; -import { MentionIdentityUser, RichEditor } from "@osn/common-ui"; +import { IpfsSquare, MentionIdentityUser, RichEditor } from "@osn/common-ui"; import { useSuggestions } from "./suggestions"; const Item = styled.div` @@ -38,13 +37,12 @@ const DividerWrapper = styled.div` display: flex; align-items: center; line-height: 24px; - color: #a1a8b3; + color: var(--textTertiary); > :not(:first-child) { ::before { content: "·"; font-size: 14px; line-height: 24px; - color: #e3e7ed; margin: 0 8px; } } @@ -53,7 +51,7 @@ const DividerWrapper = styled.div` const ContentWrapper = styled.div` margin: 8px 0 0 28px; padding-bottom: 20px; - border-bottom: 1px solid #f0f3f8; + border-bottom: 1px solid var(--strokeBorderDefault); `; const Content = styled.div` @@ -73,23 +71,9 @@ const InfoWrapper = styled.div` justify-content: space-between; `; -const Square = styled.div` - width: 20px; - height: 20px; - background: url("/imgs/icons/ipfs.svg"); - ${(p) => - !p.noHover && - css` - cursor: pointer; - :hover { - background: url("/imgs/icons/ipfs-active.svg"); - } - `} -`; - const NoCommentWrapper = styled.div` height: 104px; - border-bottom: 1px solid #f0f3f8; + border-bottom: 1px solid var(--strokeBorderDefault); > div { border: none; @@ -194,15 +178,12 @@ export default function PostDiscussion({ />
{timeDuration(item.createdAt)}
- {item?.pinHash ? ( - - - - ) : ( - - )} + diff --git a/next/components/postDetail/postInfo.js b/next/components/postDetail/postInfo.js index 5de60e5b..25cbf320 100644 --- a/next/components/postDetail/postInfo.js +++ b/next/components/postDetail/postInfo.js @@ -4,7 +4,7 @@ import moment from "moment"; import ExternalLink from "@osn/common-ui/es/ExternalLink"; import { capitalize, getExplorer } from "../../frontedUtils"; import { ChainIcon } from "@osn/common-ui"; -import Tooltip from "@/components/tooltip"; +import { Tooltip } from "@osn/common-ui"; import Panel from "@/components/postDetail/panel"; import SideSectionTitle from "@/components/sideBar/sideSectionTitle"; import AssetList from "../assetList"; @@ -18,7 +18,7 @@ const Wrapper = styled(Panel)` const Divider = styled.div` height: 1px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); margin: 12px 0; `; @@ -31,7 +31,7 @@ const InfoItem = styled.div` line-height: 24px; > :first-child { - color: #506176; + color: var(--textSecondary); margin-right: 8px; } @@ -53,7 +53,7 @@ const TimestampItem = styled.div` line-height: 24px; > :first-child { - color: #506176; + color: var(--textSecondary); } span { diff --git a/next/components/postDetail/postVote.js b/next/components/postDetail/postVote.js index 17035bff..d8b36673 100644 --- a/next/components/postDetail/postVote.js +++ b/next/components/postDetail/postVote.js @@ -37,7 +37,7 @@ import isNil from "lodash.isnil"; import { proposalStatus } from "../../frontedUtils/consts/proposal"; import { extensionCancelled } from "../../frontedUtils/consts/extension"; import { useTerminate } from "./terminate"; -import Tooltip from "../tooltip"; +import { Tooltip } from "@osn/common-ui"; import VoteBalanceDetail from "./VoteBalanceDetail"; import DelegationInfo from "./delegationInfo"; @@ -70,7 +70,7 @@ const Title = styled.div` font-size: 12px; line-height: 16px; text-align: right; - color: #a1a8b3; + color: var(--textTertiary); text-transform: capitalize; } `; diff --git a/next/components/postDetail/postVotes.js b/next/components/postDetail/postVotes.js index b48e06ce..d26be333 100644 --- a/next/components/postDetail/postVotes.js +++ b/next/components/postDetail/postVotes.js @@ -15,7 +15,7 @@ const PaginationWrapper = styled.div` const NoVoteWrapper = styled.div` height: 104px; - border-bottom: 1px solid #f0f3f8; + border-bottom: 1px solid var(--strokeBorderDefault); > div { border: none; diff --git a/next/components/postDetail/postVotesItem.js b/next/components/postDetail/postVotesItem.js index e792856f..ec5b980a 100644 --- a/next/components/postDetail/postVotesItem.js +++ b/next/components/postDetail/postVotesItem.js @@ -1,17 +1,16 @@ import { Fragment } from "react"; -import styled, { css } from "styled-components"; -import ExternalLink from "@osn/common-ui/es/ExternalLink"; +import styled from "styled-components"; import Ellipsis from "@/components/ellipsis"; -import { Flex } from "@osn/common-ui"; +import { Flex, IpfsSquare } from "@osn/common-ui"; import ValueDisplay from "@/components/valueDisplay"; import Voter from "@/components/role/voter"; -import Tooltip from "@/components/tooltip"; +import { Tooltip } from "@osn/common-ui"; import VoteBalanceDetail from "./VoteBalanceDetail"; import { isZero } from "frontedUtils"; const Item = styled.div` padding: 20px 0; - border-bottom: 1px solid #f0f3f8; + border-bottom: 1px solid var(--strokeBorderDefault); `; const InfoWrapper = styled.div` @@ -37,7 +36,7 @@ const ContentWrapper = styled.div` const Content = styled.div` line-height: 24px; - color: rgba(80, 97, 118, 1); + color: var(--textSecondary); `; const BalanceWrapper = styled.div` @@ -49,20 +48,6 @@ const BalanceWrapper = styled.div` } `; -const Square = styled.div` - width: 20px; - height: 20px; - background: url("/imgs/icons/ipfs.svg"); - ${(p) => - !p.noHover && - css` - cursor: pointer; - :hover { - background: url("/imgs/icons/ipfs-active.svg"); - } - `} -`; - const EqualWrapper = styled.div` width: 33%; display: flex; @@ -79,8 +64,8 @@ const EqualWrapper = styled.div` const MyVoteTag = styled.div` display: flex; align-items: center; - background: #f0f3f8; - color: #506176; + background-color: var(--fillBgTertiary); + color: var(--textSecondary); border-radius: 9px; padding: 2px 10px; font-weight: 600; @@ -98,7 +83,7 @@ const DelegationTag = styled.div` align-items: center; padding: 2px 8px; - border: 1px solid #d2d9e2; + border: 1px solid var(--strokeActionDefault); border-radius: 9px; font-style: normal; @@ -106,7 +91,7 @@ const DelegationTag = styled.div` font-size: 10px; line-height: 14px; - color: #a1a8b3; + color: var(--textTertiary); margin-top: 3px; margin-bottom: 3px; @@ -215,15 +200,12 @@ export default function PostVotesItem({ ) : null } /> - {data?.pinHash ? ( - - - - ) : ( - - )} + diff --git a/next/components/postDetail/strategyResult/common/optionList.js b/next/components/postDetail/strategyResult/common/optionList.js index 6bf68229..6f15eb1f 100644 --- a/next/components/postDetail/strategyResult/common/optionList.js +++ b/next/components/postDetail/strategyResult/common/optionList.js @@ -1,4 +1,4 @@ -import Tooltip from "@/components/tooltip"; +import { Tooltip } from "@osn/common-ui"; import { Divider, FlexAround, diff --git a/next/components/postDetail/strategyResult/common/styled.js b/next/components/postDetail/strategyResult/common/styled.js index adf7dcb9..2bdc0bba 100644 --- a/next/components/postDetail/strategyResult/common/styled.js +++ b/next/components/postDetail/strategyResult/common/styled.js @@ -3,7 +3,7 @@ import { p_14_medium } from "styles/textStyles"; export const Divider = styled.div` height: 1px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); margin: 12px 0; `; @@ -14,7 +14,7 @@ export const VoteItem = styled.div` ${p_14_medium}; > :first-child { - color: #506176; + color: var(--textSecondary); } `; @@ -29,7 +29,7 @@ export const ProgressItem = styled.div` export const ProgressBackground = styled.div` height: 6px; border-radius: 3px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); position: relative; overflow: hidden; `; @@ -39,14 +39,14 @@ export const ProgressBar = styled.div` height: 6px; left: 0; top: 0; - background: #6848ff; + background: var(--fillBgBrandPrimary); width: ${(p) => p.percent}; `; export const OptionIndex = styled.div` max-width: 118px; ${p_14_medium}; - color: #a1a8b3; + color: var(--textTertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -71,14 +71,14 @@ export const ResultName = styled.span` font-weight: 600; font-size: 16px; line-height: 24px; - color: #1e2134; + color: var(--textPrimary); `; export const StatusResultName = styled.span` font-weight: 500; font-size: 14px; line-height: 24px; - color: #506176; + color: var(--textSecondary); `; export const SubtitleWrapper = styled.div` @@ -92,11 +92,11 @@ export const Subtitle = styled.div` justify-self: flex-start; margin-left: 8px; svg { - fill: #a1a8b3; + fill: var(--textTertiary); } :hover { svg { - fill: #506176; + fill: var(--textSecondary); } } `; @@ -107,7 +107,7 @@ export const FlexAround = styled.div` justify-content: right; .quorum-value { - color: rgba(161, 168, 179, 1); + color: var(--textTertiary); } `; @@ -135,6 +135,8 @@ export const StatusItem = styled.div` font-size: 14px; line-height: 100%; text-align: center; - color: ${(p) => (p.positive ? "#4CAF50" : "#EE4444")}; - background: ${(p) => (p.positive ? "#EDF7ED" : "#FDECEC")}; + color: ${(p) => + p.positive ? "var(--textFeedbackSuccess)" : "var(--textFeedbackError)"}; + background: ${(p) => + p.positive ? "var(--accentGreen25a)" : "var(--accentRed25a)"}; `; diff --git a/next/components/postResult/index.js b/next/components/postResult/index.js index 6b7da634..8cf7bc50 100644 --- a/next/components/postResult/index.js +++ b/next/components/postResult/index.js @@ -18,11 +18,11 @@ const IconWrapper = styled.div` display: none; } svg { - fill: #a1a8b3; + fill: var(--textTertiary); } :hover { svg { - fill: #506176; + fill: var(--textSecondary); } } `; diff --git a/next/components/postResult/popup.js b/next/components/postResult/popup.js index 4a604b6b..8b0680fd 100644 --- a/next/components/postResult/popup.js +++ b/next/components/postResult/popup.js @@ -11,9 +11,7 @@ import BigNumber from "bignumber.js"; const ResultWrapper = styled.div` z-index: 999; position: absolute; - background: #ffffff; - filter: drop-shadow(0px 4px 31px rgba(26, 33, 44, 0.06)) - drop-shadow(0px 0.751293px 8px rgba(26, 33, 44, 0.04)); + background: var(--fillBgPrimary); padding: 24px; width: 300px; right: -24px; @@ -35,19 +33,14 @@ const Triangle = styled.div` height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; - border-top: 8px solid #ffffff; + border-top: 8px solid var(--fillBgPrimary); right: 24px; top: 100%; `; -const TriangleTop = styled.div` - position: absolute; - width: 0; - height: 0; - border-left: 8px solid transparent; - border-right: 8px solid transparent; - border-bottom: 8px solid #ffffff; - right: 24px; +const TriangleTop = styled(Triangle)` + border-top: 0; + border-bottom: 8px solid var(--fillBgPrimary); top: -8px; `; @@ -60,7 +53,7 @@ const TitleWrapper = styled.div` const Divider = styled.div` height: 1px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); margin: 16px 0; `; @@ -71,7 +64,7 @@ const VoteItem = styled.div` ${p_14_medium}; > :first-child { - color: #506176; + color: var(--textSecondary); } `; @@ -83,7 +76,7 @@ const ProgressItem = styled.div` const ProgressBackground = styled.div` height: 6px; border-radius: 3px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); position: relative; overflow: hidden; `; @@ -93,13 +86,13 @@ const ProgressBar = styled.div` height: 6px; left: 0; top: 0; - background: #6848ff; + background: var(--fillBgBrandPrimary); width: ${(p) => p.percent}; `; const OptionIndex = styled.div` ${p_14_medium}; - color: #a1a8b3; + color: var(--textTertiary); `; const OptionChoice = styled.div` @@ -175,7 +168,7 @@ export default function Popup({ data, space, isTop }) { }, [votes, data, dispatch]); return ( - + Results diff --git a/next/components/role/voter.js b/next/components/role/voter.js index 20d35b23..74008934 100644 --- a/next/components/role/voter.js +++ b/next/components/role/voter.js @@ -5,7 +5,7 @@ import { IdentityUser } from "@osn/common-ui"; const Wrapper = styled.div` display: flex; align-items: center; - color: #2e343d; + color: var(--textPrimary); > :not(:first-child) { margin-left: 4px; @@ -13,7 +13,7 @@ const Wrapper = styled.div` `; const TextMinor = styled.span` - color: #506176; + color: var(--textSecondary); word-break: break-all; `; @@ -21,7 +21,7 @@ const PopupCard = styled.div` display: flex; flex-wrap: wrap; width: 288px; - color: #1e2134; + color: var(--textPrimary); > div:first-child { display: flex; align-items: center; @@ -34,7 +34,7 @@ const Divider = styled.div` margin-bottom: 12px; height: 1px; width: 100%; - background-color: #f0f3f8; + background-color: var(--fillBgTertiary); `; export default function Voter({ diff --git a/next/components/row.js b/next/components/row.js index 9a073300..e352b90d 100644 --- a/next/components/row.js +++ b/next/components/row.js @@ -4,7 +4,7 @@ import { Flex, FlexBetween } from "@osn/common-ui"; const Header = styled.div` ${p_14_medium}; - color: #506176; + color: var(--textSecondary); flex-shrink: 1; white-space: nowrap; `; @@ -12,7 +12,7 @@ const Content = styled(Flex)` width: 100%; flex-grow: 1; ${p_14_medium}; - color: #1e2134; + color: var(--textPrimary); justify-content: right; `; diff --git a/next/components/share/copy.svg b/next/components/share/copy.svg index 724808e5..9a55c2a4 100644 --- a/next/components/share/copy.svg +++ b/next/components/share/copy.svg @@ -1,4 +1,4 @@ - - + + diff --git a/next/components/share/index.js b/next/components/share/index.js index 1a15f374..b78b615b 100644 --- a/next/components/share/index.js +++ b/next/components/share/index.js @@ -3,7 +3,7 @@ import copy from "copy-to-clipboard"; import styled from "styled-components"; import { ReactComponent as Twitter } from "./twitter.svg"; import { ReactComponent as CopySvg } from "./copy.svg"; -import Tooltip from "@/components/tooltip"; +import { Tooltip } from "@osn/common-ui"; const Wrapper = styled.div` display: flex; @@ -16,18 +16,18 @@ const ShareItem = styled.span` &:hover { .twitter { rect { - fill: #e6f4fe; + fill: var(--accentBlue25a); } path { - fill: #33a2f2; + fill: var(--accentBlue500a); } } .copy { rect { - fill: #edf7ed; + fill: var(--accentGreen25a); } path { - fill: #4caf50; + fill: var(--textFeedbackSuccess); } } } diff --git a/next/components/share/twitter.svg b/next/components/share/twitter.svg index 090ad0c9..f9d044ca 100644 --- a/next/components/share/twitter.svg +++ b/next/components/share/twitter.svg @@ -1,5 +1,5 @@ - + + fill="var(--textTertiary, #A1A8B3)"/> diff --git a/next/components/sideBar/sideSectionTitle.js b/next/components/sideBar/sideSectionTitle.js index 4bc5cb06..a5fcd697 100644 --- a/next/components/sideBar/sideSectionTitle.js +++ b/next/components/sideBar/sideSectionTitle.js @@ -3,7 +3,7 @@ import { p_16_semibold } from "../../styles/textStyles"; import { memo } from "react"; import { Flex, FlexBetween } from "@osn/common-ui"; import SubTitle from "@osn/common-ui/es/styled/SubTitle"; -import Tooltip from "@/components/tooltip"; +import { Tooltip } from "@osn/common-ui"; import { ReactComponent as QuestionMark } from "../../public/imgs/icons/question-mark.svg"; const TitleWrapper = styled(FlexBetween)` diff --git a/next/components/snapshotHeightPicker.js b/next/components/snapshotHeightPicker.js index 5ed7ef45..aefda902 100644 --- a/next/components/snapshotHeightPicker.js +++ b/next/components/snapshotHeightPicker.js @@ -25,9 +25,8 @@ const DialogWrapper = styled.div` right: 0; padding: 24px; width: 328px; - background: #ffffff; - box-shadow: 0 4px 31px rgba(26, 33, 44, 0.06), - 0 0.751293px 8px rgba(26, 33, 44, 0.04); + background: var(--fillBgPrimary); + box-shadow: var(--shadowCardDefault); input { margin-bottom: 8px; } diff --git a/next/components/space.js b/next/components/space.js index 7bed3de5..9fd433b2 100644 --- a/next/components/space.js +++ b/next/components/space.js @@ -45,7 +45,7 @@ const TitleWrapper = styled.div` const SpaceButton = styled.div` cursor: pointer; ${p_16_semibold}; - color: #506176; + color: var(--textSecondary); `; const ButtonWrapper = styled.div` diff --git a/next/components/spaceListItem/index.js b/next/components/spaceListItem/index.js index 58c4e4df..4075b779 100644 --- a/next/components/spaceListItem/index.js +++ b/next/components/spaceListItem/index.js @@ -7,7 +7,7 @@ import { loginAddressSelector, } from "store/reducers/accountSlice"; import InternalLink from "../internalLink"; -import { shadow_100, shadow_200, makeSquare } from "../../styles/globalCss"; +import { makeSquare } from "../../styles/globalCss"; import { p_18_semibold } from "../../styles/textStyles"; import SpaceLogo from "@/components/spaceLogo"; import nextApi from "services/nextApi"; @@ -27,20 +27,20 @@ const Icon = styled.div` const Name = styled.div` white-space: nowrap; ${p_18_semibold}; - color: #2e343d; + color: var(--textPrimary); text-transform: capitalize; `; const Symbol = styled.div` font-size: 14px; line-height: 24px; - color: #a1a8b3; + color: var(--textTertiary); `; const Divider = styled.div` min-width: 116px; height: 1px; - background: #f0f3f8; + background-color: var(--fillBgTertiary); margin: 12px 0; `; @@ -49,13 +49,13 @@ const ActiveWrapper = styled.div` align-items: center; font-size: 14px; line-height: 24px; - color: #a1a8b3; + color: var(--textTertiary); `; const ActiveCircle = styled.div` ${makeSquare(6)}; border-radius: 50%; - background: #56ca2f; + background-color: var(--accentGreen500a); margin-right: 8px; `; @@ -64,22 +64,22 @@ const Count = styled.span` `; const ActiveCount = styled(Count)` - color: #506176; + color: var(--textSecondary); `; const Wrapper = styled.div` position: relative; flex: 0 0 auto; - border: 1px solid #f0f3f8; - ${shadow_100}; - background: #ffffff; + border: 1px solid var(--strokeBorderDefault); + box-shadow: var(--shadowCardDefault); + background: var(--fillBgPrimary); padding: 24px; cursor: pointer; width: 200px; :hover { - border-color: #e2e8f0; - ${shadow_200} + border-color: var(--strokeActionDefault); + box-shadow: var(--shadowCardHover); } `; diff --git a/next/components/spaceListItem/joinButton.js b/next/components/spaceListItem/joinButton.js index 8aa9b389..8582d70e 100644 --- a/next/components/spaceListItem/joinButton.js +++ b/next/components/spaceListItem/joinButton.js @@ -1,20 +1,19 @@ import styled from "styled-components"; -import Tooltip from "../tooltip"; +import { Tooltip } from "@osn/common-ui"; import { ReactComponent as JoinedSVG } from "./joined.svg"; import { ReactComponent as NotJoinedSVG } from "./not-joined.svg"; const NotJoinedMark = styled(NotJoinedSVG)` &:hover { path { - fill: #B7C0CC; + fill: var(--strokeActionActive); } } `; const JoinedMark = styled(JoinedSVG)``; - -export default function JoinButton({ joined, onClick = ()=>{} }) { +export default function JoinButton({ joined, onClick = () => {} }) { if (!joined) { return ( diff --git a/next/components/spaceListItem/joined.svg b/next/components/spaceListItem/joined.svg index 999214aa..fdc18853 100644 --- a/next/components/spaceListItem/joined.svg +++ b/next/components/spaceListItem/joined.svg @@ -2,8 +2,8 @@ - - + + diff --git a/next/components/spaceListItem/not-joined.svg b/next/components/spaceListItem/not-joined.svg index 4148440b..8f03f12e 100644 --- a/next/components/spaceListItem/not-joined.svg +++ b/next/components/spaceListItem/not-joined.svg @@ -1,3 +1,3 @@ - + diff --git a/next/components/spaceLogo.js b/next/components/spaceLogo.js index b584fcb5..ed5d8b37 100644 --- a/next/components/spaceLogo.js +++ b/next/components/spaceLogo.js @@ -4,7 +4,7 @@ import { getSpaceIconUrl } from "frontedUtils/space"; const LogoImg = styled.img` ${makeSquare(64)}; - border: 1px solid #e2e8f0; + border: 1px solid var(--strokeActionDefault); border-radius: 32px; margin-right: 24px; `; diff --git a/next/components/steps/checked.svg b/next/components/steps/checked.svg index 6fee5fe8..a4798eb7 100644 --- a/next/components/steps/checked.svg +++ b/next/components/steps/checked.svg @@ -1,6 +1,6 @@ - + diff --git a/next/components/steps/checkedIndex.js b/next/components/steps/checkedIndex.js index 177a563d..2d4b198a 100644 --- a/next/components/steps/checkedIndex.js +++ b/next/components/steps/checkedIndex.js @@ -3,7 +3,7 @@ import { ReactComponent as CheckedSVG } from "./checked.svg"; import { Index } from "./styled"; const Wrapper = styled(Index)` - border-color: #04d2c5; + border-color: var(--strokeBgBrandSecondary); `; export default function CheckedIndex() { diff --git a/next/components/steps/currentIndex.js b/next/components/steps/currentIndex.js index b895997a..be04e217 100644 --- a/next/components/steps/currentIndex.js +++ b/next/components/steps/currentIndex.js @@ -2,9 +2,9 @@ import styled from "styled-components"; import { Index } from "./styled"; const Wrapper = styled(Index)` - background: #04d2c5; - color: #ffffff; - border-color: #04d2c5; + background: var(--fillBgBrandSecondary); + color: var(--textPrimaryContrast); + border-color: var(--strokeBgBrandSecondary); `; export default function CurrentIndex({ children }) { diff --git a/next/components/steps/step.js b/next/components/steps/step.js index 64497994..9e468633 100644 --- a/next/components/steps/step.js +++ b/next/components/steps/step.js @@ -1,4 +1,4 @@ -import styled from "styled-components"; +import styled, { css } from "styled-components"; import CheckedIndex from "./checkedIndex"; import CurrentIndex from "./currentIndex"; import { Index, NavigationLine } from "./styled"; @@ -19,7 +19,13 @@ const Title = styled.span` font-size: 16px; line-height: 24px; - color: ${({ isCurrent }) => (isCurrent ? "#04D2C5" : "#000000")}; + color: var(--textPrimary); + + ${(p) => + p.isCurrent && + css` + color: var(--textBrandSecondary); + `} `; export default function Step({ step, index = 0, currentStep = 0, isLast }) { diff --git a/next/components/steps/styled.js b/next/components/steps/styled.js index b644c832..fb2029ae 100644 --- a/next/components/steps/styled.js +++ b/next/components/steps/styled.js @@ -8,14 +8,14 @@ export const Index = styled.div` width: 32px; height: 32px; - border: 2px solid #b7c0cc; + border: 2px solid var(--strokeActionDefault); font-style: normal; font-weight: 600; font-size: 16px; line-height: 24px; - color: #a1a8b3; + color: var(--textTertiary); `; export const NavigationLine = styled.div` @@ -23,11 +23,11 @@ export const NavigationLine = styled.div` min-width: 30px; height: 0px; - border: 2px solid #04d2c5; + border: 2px solid var(--strokeBgBrandSecondary); ${({ isHidden }) => isHidden && css` - border-color: rgba(0, 0, 0, 0); + border-color: transparent; `} `; diff --git a/next/components/styled/divider.js b/next/components/styled/divider.js index 48f37fb4..ee337513 100644 --- a/next/components/styled/divider.js +++ b/next/components/styled/divider.js @@ -3,7 +3,7 @@ import styled from "styled-components"; const Divider = styled.div` width: 100%; height: 1px; - background-color: #f0f3f8; + background-color: var(--fillBgTertiary); margin-top: 16px; margin-bottom: 16px; `; diff --git a/next/components/styled/dropdown.js b/next/components/styled/dropdown.js deleted file mode 100644 index 191fbe04..00000000 --- a/next/components/styled/dropdown.js +++ /dev/null @@ -1,39 +0,0 @@ -import styled from "styled-components"; -import { Dropdown } from "semantic-ui-react"; - -const StyledDropdown = styled(Dropdown)` - width: 100%; - height: 64px !important; - border-radius: 0 !important; - - :active, - :hover, - :focus { - border-color: #cccccc !important; - } - - &.active, - & .menu { - border-color: #cccccc !important; - } - - .ui.selection.dropdown { - min-height: 48px !important; - } - - &.ui.dropdown .menu > .item { - padding: 0 !important; - } - - .icon { - top: 50% !important; - transform: translate(0, -9px) !important; - opacity: 0.24 !important; - } - - .menu { - border-radius: 0 !important; - } -`; - -export default StyledDropdown; diff --git a/next/components/styled/errorMessage.js b/next/components/styled/errorMessage.js index 5589420a..9f1498fe 100644 --- a/next/components/styled/errorMessage.js +++ b/next/components/styled/errorMessage.js @@ -5,5 +5,5 @@ export const ErrorMessage = styled.div` font-weight: 400; font-size: 14px; line-height: 24px; - color: #ee4444; + color: var(--textFeedbackError); `; diff --git a/next/components/toast/index.js b/next/components/toast/index.js index 117b0bd9..eaa9bacb 100644 --- a/next/components/toast/index.js +++ b/next/components/toast/index.js @@ -6,7 +6,6 @@ import { toastsSelector } from "store/reducers/toastSlice"; const Wrapper = styled.div` position: fixed; - width: 100vw; height: 0; left: 0; top: 0; diff --git a/next/components/toast/toastItem.js b/next/components/toast/toastItem.js index a468e92a..176c7235 100644 --- a/next/components/toast/toastItem.js +++ b/next/components/toast/toastItem.js @@ -7,17 +7,16 @@ import { ReactComponent as Close } from "public/imgs/icons/close.svg"; import { ReactComponent as Sticky } from "public/imgs/icons/sticky.svg"; import { TOAST_TYPES } from "frontedUtils/constants"; import { useIsMounted } from "frontedUtils/hooks"; +import { cn } from "@osn/common-ui"; const Wrapper = styled.div` padding: 20px; width: 400px; - background: #ffffff; - filter: drop-shadow(0px 4px 31px rgba(26, 33, 44, 0.06)) - drop-shadow(0px 0.751293px 8px rgba(26, 33, 44, 0.04)); - color: rgba(17, 17, 17, 0.65); + background: var(--fillBgPrimary); + color: var(--textSecondary); display: flex; align-items: flex-start; - border-left: 4px solid #ffffff; + border-left: 4px solid var(--strokeActionDefault); ${(p) => p.color && css` @@ -47,7 +46,7 @@ const Title = styled.div` const Content = styled.div` font-size: 14px; line-height: 24px; - color: #506176; + color: var(--textSecondary); word-wrap: break-word; word-break: break-all; `; @@ -57,13 +56,13 @@ const RightWrapper = styled.div` cursor: pointer; > svg { path { - fill: #9da9bb; + fill: var(--textTertiary); } - fill: #9da9bb; + fill: var(--textTertiary); :hover { - fill: #2e343d; + fill: var(--textPrimary); path { - fill: #2e343d; + fill: var(--textPrimary); } } } @@ -72,14 +71,14 @@ const RightWrapper = styled.div` const getToastColor = (type) => { switch (type) { case TOAST_TYPES.SUCCESS: - return "#4CAF50"; + return "var(--textFeedbackSuccess)"; case TOAST_TYPES.ERROR: - return "#EE4444"; + return "var(--textFeedbackError)"; case TOAST_TYPES.INFO: case TOAST_TYPES.PENDING: - return "#6848FF"; + return "var(--fillBgBrandPrimary)"; default: - return "#9DA9BB"; + return "var(--textTertiary)"; } }; @@ -108,7 +107,7 @@ const ToastItem = ({ type, message, id, sticky }) => { if (!message) return null; return ( - + {type} {message} diff --git a/next/components/tooltip-bak/index.js b/next/components/tooltip-bak/index.js deleted file mode 100644 index f7cce925..00000000 --- a/next/components/tooltip-bak/index.js +++ /dev/null @@ -1,98 +0,0 @@ -import styled, { css } from "styled-components"; -import { useDispatch } from "react-redux"; -import copy from "copy-to-clipboard"; - -import { newSuccessToast } from "store/reducers/toastSlice"; - -const PopupWrapper = styled.div` - cursor: auto; - display: none; - position: absolute; - padding-bottom: 10px; - left: 50%; - bottom: 100%; - transform: translateX(-50%); - z-index: 1; - ${(p) => - p.isCopy && - css` - cursor: pointer; - `} -`; - -const Popup = styled.div` - position: relative; - background: rgba(0, 0, 0, 0.65); - border-radius: 4px; - max-width: 257px; - min-width: ${(p) => (p.noMinWidth ? "none" : "120px")}; - padding: 6px 12px; - font-size: 12px; - line-height: 16px; - color: #ffffff; - word-wrap: break-word; - text-align: left; -`; - -const Triangle = styled.div` - position: absolute; - width: 0; - height: 0; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid rgba(0, 0, 0, 0.65); - left: 50%; - top: 100%; - transform: translateX(-50%); -`; - -const ChildrenWrapper = styled.div` - color: red; - position: relative; - display: inline-block; - :hover { - > * { - display: block; - } - } -`; - -const TitleWrapper = styled.div` - font-weight: bold; - font-size: 12px; - line-height: 16px; - color: #ffffff; - white-space: nowrap; -`; - -export default function Tooltip({ - content, - children, - isCopy, - copyText, - title, - noMinWidth, -}) { - const dispatch = useDispatch(); - - const onCopy = () => { - if (isCopy && content && copy(copyText || content)) { - dispatch(newSuccessToast("Copied")); - } - }; - - return ( - - {children} - {content && ( - - - {title && {title}} - {content} - - - - )} - - ); -} diff --git a/next/components/tooltip.js b/next/components/tooltip.js deleted file mode 100644 index b4fe1429..00000000 --- a/next/components/tooltip.js +++ /dev/null @@ -1,204 +0,0 @@ -import styled, { css } from "styled-components"; -import { useDispatch } from "react-redux"; -import copy from "copy-to-clipboard"; - -import { newSuccessToast } from "store/reducers/toastSlice"; -import { p_14_normal } from "../styles/textStyles"; - -const Wrapper = styled.div` - display: inline-flex; - position: relative; - font-size: 14px; - line-height: 16px; - color: rgba(17, 17, 17, 0.65); - > svg { - stroke-opacity: 0.65; - } - :hover { - color: #111111; - > svg { - stroke-opacity: 1; - } - > * { - display: block !important; - } - } - ${(p) => - p.bg && - css` - padding: 6px 12px; - background: #f4f4f4; - border-radius: 4px; - :hover { - background: #eeeeee; - } - `} -`; - -const PopupWrapper = styled.div` - cursor: auto; - display: none !important; - position: absolute; - padding-bottom: 10px; - left: 50%; - bottom: 100%; - transform: translateX(-50%); - z-index: 1; - ${(p) => - p.isCopy && - css` - cursor: pointer; - `} - ${(p) => - p.position === "down" && - css` - top: 100%; - padding-bottom: 0; - padding-top: 10px; - `} - ${(p) => - p.offset && - css` - margin-top: ${p.offset}; - `} -`; - -const Popup = styled.div` - position: relative; - background: rgba(25, 30, 39, 0.9); - white-space: nowrap; - padding: 8px 12px; - ${p_14_normal}; - color: #ffffff; - word-wrap: break-word; -`; - -const Triangle = styled.div` - position: absolute; - width: 0; - height: 0; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid rgba(25, 30, 39, 0.9); - left: 50%; - top: 100%; - transform: translateX(-50%); -`; - -const TopTriangle = styled.div` - position: absolute; - width: 0; - height: 0; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid rgba(25, 30, 39, 0.9); - left: 50%; - top: -6px; - transform: translateX(-50%); -`; - -const ChildrenWrapper = styled.div` - position: relative; - display: inline-flex; - :hover { - > * { - display: block !important; - } - } - > svg { - display: block; - } - ${(p) => - p.size === "full" && - css` - width: 100%; - height: 100%; - `} - ${(p) => - p.size === "fit" && - css` - width: fit-content; - position: relative; - `} -`; - -const TitleWrapper = styled.div` - font-weight: bold; - font-size: 12px; - line-height: 16px; - color: #ffffff; -`; - -const TooltipIcon = styled.img` - width: ${({ size }) => size || 24}px; - height: ${({ size }) => size || 24}px; -`; - -export default function Tooltip({ - label, - bg, - content, - children, - isCopy, - copyText, - title, - size, - iconSize, - position, - offset, -}) { - const dispatch = useDispatch(); - - const onCopy = () => { - if (isCopy && content && copy(copyText || content)) { - dispatch(newSuccessToast("Copied")); - } - }; - - return ( - <> - {children ? ( - - {children} - {content && ( - - - {position === "down" && } - {title && {title}} - {content} - {position !== "down" && } - - - )} - - ) : ( - - {label && label} - {!label && ( - - )} - {content && ( - - - {position === "down" && } - {title && {title}} - {content} - {position !== "down" && } - - - )} - - )} - - ); -} diff --git a/next/components/uploadBanner/uploader.js b/next/components/uploadBanner/uploader.js index 35c1e738..cec1b8c6 100644 --- a/next/components/uploadBanner/uploader.js +++ b/next/components/uploadBanner/uploader.js @@ -1,14 +1,9 @@ import React, { useRef, useState } from "react"; import styled from "styled-components"; -import { Flex } from "@osn/common-ui"; +import { Flex, cn } from "@osn/common-ui"; import nextApi from "services/nextApi"; import { LoadingIcon } from "@osn/common-ui"; -import { ReactComponent as Upload } from "../../public/imgs/icons/upload.svg"; - -const UploadIcon = styled(Upload)` - flex-basis: 100%; - cursor: pointer; -`; +import { SystemUpload } from "@osn/icons/opensquare"; const Wrapper = styled.div` position: relative; @@ -18,14 +13,6 @@ const Wrapper = styled.div` } `; -const UploadArea = styled(Flex)` - padding-top: 16px; - padding-bottom: 16px; - justify-content: center; - border: 1px dashed; - border-color: ${(props) => props.theme.neutralGrey300}; -`; - const Tips = styled.ul` padding: 0; list-style: none; @@ -67,12 +54,6 @@ const Delete = styled(Button)` flex-basis: 100%; margin-left: calc(50% - 20px); `; -const UploadTip = styled.p` - display: flex; - align-items: center; - justify-content: center; - flex-wrap: wrap; -`; const BannerPreview = styled(Flex)` flex-wrap: wrap; justify-content: center; @@ -91,6 +72,10 @@ function Uploader({ setBannerUrl }) { const [uploading, setUploading] = useState(false); const handleSelectFile = () => { + if (uploading) { + return; + } + inputEl.current?.click(); }; @@ -159,14 +144,18 @@ function Uploader({ setBannerUrl }) { return ( - {uploading ? ( - + ) : ( <> {currentBanner ? ( @@ -175,17 +164,23 @@ function Uploader({ setBannerUrl }) { Delete ) : ( - - +
+
+ +
Drop image or Upload - +
)} )} - +
  • We recommend a 16:9 image.
  • The banner will be a shared preview on social media.
  • diff --git a/next/components/valueDisplay.js b/next/components/valueDisplay.js index 36373004..3168c239 100644 --- a/next/components/valueDisplay.js +++ b/next/components/valueDisplay.js @@ -1,4 +1,4 @@ -import Tooltip from "components/tooltip"; +import { Tooltip } from "@osn/common-ui"; import { abbreviateBigNumber, getEffectiveNumbers, diff --git a/next/next.config.js b/next/next.config.js index 0e347641..c460a5a9 100644 --- a/next/next.config.js +++ b/next/next.config.js @@ -1,3 +1,5 @@ +const path = require("node:path"); + /** @type {import('next').NextConfig} */ module.exports = { transpilePackages: ["@osn/common-ui", "@osn/common", "@osn/rich-text-editor"], @@ -31,6 +33,18 @@ module.exports = { }, ], }); + + alias("react"); + alias("styled-components"); + + function alias(module) { + config.resolve.alias[module] = path.resolve( + __dirname, + "node_modules", + module, + ); + } + return config; }, }; diff --git a/next/package.json b/next/package.json index 3c8fceab..71030dd0 100644 --- a/next/package.json +++ b/next/package.json @@ -11,11 +11,12 @@ }, "dependencies": { "@osn/common": "^1.3.5", - "@osn/common-ui": "^1.18.10", + "@osn/common-ui": "^1.20.0", "@osn/constants": "^1.1.2", - "@osn/polkadot-react-identicon": "^1.0.8", - "@osn/previewer": "^0.12.3", - "@osn/rich-text-editor": "^0.1.56", + "@osn/icons": "^1.83.0", + "@osn/polkadot-react-identicon": "^1.0.10", + "@osn/previewer": "^1.2.2", + "@osn/rich-text-editor": "^0.6.6", "@polkadot/api": "^9.4.2", "@polkadot/extension-dapp": "0.44.6", "@polkadot/util": "10.1.9", @@ -54,18 +55,20 @@ "styled-components": "^5.3.1" }, "devDependencies": { - "@osn/eslint-config": "^1.0.1", + "@osn/eslint-config": "^1.0.2", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^12.1.1", + "autoprefixer": "^10.4.16", "babel-jest": "^27.2.2", - "eslint": "^8.38.0", - "eslint-config-next": "^13.3.0", + "eslint": "^8.57.0", + "eslint-config-next": "^14.1.4", "file-loader": "^6.2.0", "identity-obj-proxy": "^3.0.0", "jest": "^27.3.0", "jest-environment-node": "^27.3.0", + "postcss": "^8.4.33", "postinstall-postinstall": "^2.1.0", - "react-test-renderer": "^17.0.2" + "tailwindcss": "^3.4.1" }, "packageManager": "yarn@3.6.4" } diff --git a/next/pages/404.js b/next/pages/404.js index 6c100033..c9d3b066 100644 --- a/next/pages/404.js +++ b/next/pages/404.js @@ -7,18 +7,17 @@ import InternalLink from "@/components/internalLink"; const Wrapper = styled.div` min-height: 100vh; - width: 100vw; overflow: hidden; display: flex; flex-direction: column; `; const Section = styled.div` - background: #fff; + background: var(--fillBgPrimary); @media screen and (max-width: 800px) { border-top: none; } - border-bottom: 1px solid #f0f3f8; + border-bottom: 1px solid var(--strokeBorderDefault); `; const H1 = styled.h1` @@ -26,6 +25,7 @@ const H1 = styled.h1` ${h3_36_bold}; @media screen and (max-width: 800px) { ${h4_24_bold}; + padding-top: 30px; padding-bottom: 30px; padding-left: 40px; } @@ -37,7 +37,7 @@ const Content = styled.div` padding-top: 80px; height: 488px; ${p_16_normal}; - color: #506176; + color: var(--textSecondary); background-image: url("/imgs/backgrounds/bg-404.png"); background-position-x: 50%; background-repeat: no-repeat; @@ -55,7 +55,7 @@ const Content = styled.div` display: inline-block; padding-left: 16px; padding-right: 16px; - border: 1px solid #b7c0cc; + border: 1px solid var(--strokeActionActive); line-height: 40px; } `; @@ -73,7 +73,10 @@ export default function FourOFour() { Sorry. the content you’re looking for doesn’t exist. Either it was removed, or you mistyped the link.

    - Back to Square + +
    + Back to Square +