Skip to content

Commit

Permalink
Merge pull request #60 from Magickbase/add_hedaer_service_links
Browse files Browse the repository at this point in the history
feat: add header service links
  • Loading branch information
PainterPuppets authored Feb 23, 2024
2 parents 7a94cce + 1f94291 commit c52664d
Show file tree
Hide file tree
Showing 14 changed files with 144 additions and 73 deletions.
3 changes: 3 additions & 0 deletions packages/magickbase/src/components/ContactUs/copySimple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/magickbase/src/components/ContactUs/done.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 20 additions & 17 deletions packages/magickbase/src/components/ContactUs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import classnames from 'classnames'
import Spline from '@splinetool/react-spline'
import { useCopyToClipboard } from '@uidotdev/usehooks'
import { Modal, ModalProps } from '@/components/Modal'
import { Tooltip } from '@/components/Tooltip'
import toast from 'react-hot-toast'
import { useIsMobile } from '@magickbase-website/shared'
import styles from './styles.module.scss'
import leftElement from './leftElement.png'
import rightElement from './rightElement.png'
import CopySvg from './copy.svg'
import CopySimpleSvg from './copySimple.svg'
import DoneSvg from './done.svg'
import MoreSvg from './more.svg'
import bgImage from './bg.png'

Expand All @@ -18,13 +21,8 @@ export const ContactUs: FC<ComponentProps<'div'>> = ({ className, ...props }) =>
const isMobile = useIsMobile()

const copy = () => {
copyToClipboard('[email protected]')
.then(() => {
toast.success('copied!')
})
.catch(() => {
toast.error('copy failed, please try to paste manually.')
})
void copyToClipboard('[email protected]')
toast.success('copied!')
}

return (
Expand All @@ -51,7 +49,7 @@ export const ContactUs: FC<ComponentProps<'div'>> = ({ className, ...props }) =>
/>
</div>

<div className="flex flex-col flex-1 z-10 items-center md:items-start md:max-w-[50%]">
<div className="flex flex-col flex-1 z-[2] items-center md:items-start md:max-w-[50%]">
<h1 className="text-3xl mb-6 md:mb-8">Contact us</h1>
<p className="text-xl mb-8 text-[#999999] leading-8 text-center md:text-start">
Magickbase consistently adheres to the spirit of open source mutual benefit, and welcomes users to
Expand All @@ -65,17 +63,22 @@ export const ContactUs: FC<ComponentProps<'div'>> = ({ className, ...props }) =>
Contact Now
</button>
) : (
<div
className={classnames(
'tooltip after:top-[-14px] after:z-10 after:border-t-[#333] after:border-[8px]',
'before:bottom-[72px] before:text-base before:p-4 before:shadow-md before:shadow-[#ffffff4d]',
)}
data-tip="[email protected]"
<Tooltip
content={
<div className='flex items-center'>
[email protected]{' '}
{copiedText === '[email protected]' ? (
<DoneSvg className="ml-2"/>
) : (
<CopySimpleSvg className="ml-2 cursor-pointer" onClick={() => copy()} />
)}
</div>
}
>
<button className="border-[1px] border-solid border-white rounded-xl py-4 px-6" onClick={() => copy()}>
<div className="border-[1px] border-solid border-white rounded-xl py-4 px-6">
Contact Now
</button>
</div>
</div>
</Tooltip>
)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
right: 0;
top: 0;
bottom: 0;
z-index: 1;
}

.motion {
Expand Down
25 changes: 25 additions & 0 deletions packages/magickbase/src/components/Tooltip/index.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@import '../../styles/variables.module';

.content {
max-width: 596px;
margin-bottom: 7px;
padding: 12px 16px;
color: var(--colorPrimary);
font-size: 16px;
line-height: 200%;
background: #111;
border: 1px solid #333;
box-shadow: 0 6px 16px #333;
border-radius: 8px;
backdrop-filter: blur(38px);

@media (max-width: $mobileBreakPoint) {
max-width: 256px;
}
}

.arrow {
fill: #111;
stroke: #333;
stroke-width: 0.4px;
}
39 changes: 39 additions & 0 deletions packages/magickbase/src/components/Tooltip/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { FC, PropsWithChildren, ReactNode } from 'react'
import * as RadixTooltip from '@radix-ui/react-tooltip'
import * as RadixPopover from '@radix-ui/react-popover'
import clsx from 'clsx'
import { useIsMobile } from '@magickbase-website/shared'
import styles from './index.module.scss'

export const Tooltip: FC<PropsWithChildren<{ content?: ReactNode; className?: string }>> = props => {
const isMobile = useIsMobile()

return isMobile ? (
// RadixTooltip does not support mobile, so use RadixPopover instead.
<RadixPopover.Root>
<RadixPopover.Trigger className={clsx(styles.trigger, props.className)}>{props.children}</RadixPopover.Trigger>
<RadixPopover.Portal>
<RadixPopover.Content className={styles.content}>
{props.content}
{/* TODO: The inside border line needs to be hidden */}
<RadixPopover.Arrow className={styles.arrow} width={32} height={16} />
</RadixPopover.Content>
</RadixPopover.Portal>
</RadixPopover.Root>
) : (
<RadixTooltip.Root>
<RadixTooltip.Trigger className={clsx(styles.trigger, props.className)}>{props.children}</RadixTooltip.Trigger>
<RadixTooltip.Portal>
<RadixTooltip.Content side="top" className={styles.content}>
{props.content}
{/* TODO: The inside border line needs to be hidden */}
<RadixTooltip.Arrow className={styles.arrow} width={32} height={16} />
</RadixTooltip.Content>
</RadixTooltip.Portal>
</RadixTooltip.Root>
)
}

export const TooltipProvider: FC<PropsWithChildren> = props => {
return <RadixTooltip.Provider delayDuration={0}>{props.children}</RadixTooltip.Provider>
}
8 changes: 7 additions & 1 deletion packages/magickbase/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// TODO: The two files need to be merged later.
import './globals.css'
import '../styles/globals.scss'
import 'overlayscrollbars/overlayscrollbars.css'
import type { AppProps } from 'next/app'
import { appWithTranslation } from 'next-i18next'
import { api } from '../utils/api'
import { TooltipProvider } from '../components/Tooltip'

function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
return (
<TooltipProvider>
<Component {...pageProps} />
</TooltipProvider>
)
}

export default api.withTRPC(appWithTranslation(App))
62 changes: 27 additions & 35 deletions packages/magickbase/src/pages/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@
@variants responsive {
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
}
}

:root {
--max-width: 1100px;
--border-radius: 12px;
--font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono',
'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro',
'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;
--font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono', 'Oxygen Mono',
'Ubuntu Monospace', 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;

--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
Expand All @@ -36,22 +35,11 @@
#0071ff33 160deg,
transparent 360deg
);
--secondary-glow: radial-gradient(
rgba(255, 255, 255, 1),
rgba(255, 255, 255, 0)
);
--secondary-glow: radial-gradient(rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));

--tile-start-rgb: 239, 245, 249;
--tile-end-rgb: 228, 232, 233;
--tile-border: conic-gradient(
#00000080,
#00000040,
#00000030,
#00000020,
#00000010,
#00000010,
#00000080
);
--tile-border: conic-gradient(#00000080, #00000040, #00000030, #00000020, #00000010, #00000010, #00000080);

--callout-rgb: 238, 240, 241;
--callout-border-rgb: 172, 175, 176;
Expand All @@ -66,24 +54,11 @@
--background-end-rgb: 0, 0, 0;

--primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0));
--secondary-glow: linear-gradient(
to bottom right,
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0.3)
);
--secondary-glow: linear-gradient(to bottom right, rgba(1, 65, 255, 0), rgba(1, 65, 255, 0), rgba(1, 65, 255, 0.3));

--tile-start-rgb: 2, 13, 46;
--tile-end-rgb: 2, 5, 19;
--tile-border: conic-gradient(
#ffffff80,
#ffffff40,
#ffffff30,
#ffffff20,
#ffffff10,
#ffffff10,
#ffffff80
);
--tile-border: conic-gradient(#ffffff80, #ffffff40, #ffffff30, #ffffff20, #ffffff10, #ffffff10, #ffffff80);

--callout-rgb: 20, 20, 20;
--callout-border-rgb: 108, 108, 108;
Expand All @@ -106,7 +81,7 @@ body {

body {
color: #fff;
background: #000
background: #000;
}

a {
Expand All @@ -119,3 +94,20 @@ a {
color-scheme: dark;
}
}

/* .os-scrollbar {
--os-size: 11px;
--os-handle-border: 0.5px solid rgb(153 153 153 / 50%);
--os-handle-border-radius: 32px;
--os-handle-bg: rgb(0 0 0 / 10%);
--os-handle-border-hover: var(--os-handle-border);
--os-handle-bg-hover: var(--os-handle-bg);
--os-handle-border-active: var(--os-handle-border);
--os-handle-bg-active: var(--os-handle-bg);
transition: opacity 0.2s;
}
.os-scrollbar-auto-hide.os-scrollbar-auto-hide-hidden {
visibility: unset;
} */
6 changes: 3 additions & 3 deletions packages/magickbase/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export default function Home() {

return (
<>
<Header />
<Branding id="branding" className="snap-always snap-center" />
<Header className='z-10' />
<Branding id="branding" className="snap-always snap-center z-0" />
<div className={styles.separate} />
<AboutUs />
<div className={styles.separate} />
<Services className="min-h-screen snap-always snap-center" />
<div className={styles.separate} />
<ContactUs className="min-h-screen snap-always snap-center" />
<ContactUs className="min-h-screen snap-always snap-center z-0" />
<Footer className="snap-always snap-center" serviceState={aggregateStateQuery.data} />
<TailwindToaster />
</>
Expand Down
8 changes: 5 additions & 3 deletions packages/shared/src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export const Footer: FC<FooterProps> = ({
</Link>
</div>

<div className={styles.serviceMonitor}>{t('Service Monitor')}</div>
<Link href="https://status-website-delta.vercel.app" target="_blank">
<div className={styles.serviceMonitor}>{t('Service Monitor')}</div>
</Link>

<Contacts className={styles.contacts} />

Expand All @@ -72,8 +74,8 @@ export const Footer: FC<FooterProps> = ({
<LinkWithEffect href="https://github.com/ckb-js/kuai" target="_blank">
{t('Kuai')}
</LinkWithEffect>
<LinkWithEffect href="https://github.com/nervosnetwork/ckb/wiki/Public-JSON-RPC-nodes" target="_blank">
{t('Public Node')}
<LinkWithEffect href="https://lumos-website.vercel.app/" target="_blank">
{t('Lumos')}
</LinkWithEffect>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/components/Header/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ $desktopHeaderContentHeight: 88px;
top: 0;
right: 0;
bottom: 0;
z-index: 1;
z-index: 10;
display: flex;
flex-direction: column;
padding: 0 var(--menuIconRightOffset) 96px 96px;
Expand Down
20 changes: 9 additions & 11 deletions packages/shared/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,22 @@ const MenuDialog: FC<Pick<HeaderProps, 'navMenuGroupName' | 'navMenus'>> = ({ na
</>
)}

<LinkWithEffect className={styles.title} href="/">
<LinkWithEffect className={styles.title} href="https://magickbase.com/">
{t('Home')}
</LinkWithEffect>

<div className={styles.title}>{t('Services')}</div>
<div className={styles.links}>
<LinkWithEffect href="https://neuron.magickbase.com/">{t('Neuron Wallet')}</LinkWithEffect>
<span title="Coming soon">{t('CKB Explorer')}</span>
<span title="Coming soon">{t('Godwoke Explorer')}</span>
<span title="Coming soon">{t('Axon Explorer')}</span>
<span title="Coming soon">{t('Kuai')}</span>
<LinkWithEffect href="https://neuron.magickbase.com/en">{t('Neuron Wallet')}</LinkWithEffect>
<LinkWithEffect href="https://explorer.nervos.org/">{t('CKB Explorer')}</LinkWithEffect>
<LinkWithEffect href="https://v1.gwscan.com/">{t('Godwoke Explorer')}</LinkWithEffect>
<LinkWithEffect href="https://github.com/Magickbase/blockscan">{t('Axon Explorer')}</LinkWithEffect>
<LinkWithEffect href="https://lumos-website.vercel.app/">{t('Lumos')}</LinkWithEffect>
<LinkWithEffect href="https://github.com/ckb-js/kuai">{t('Kuai')}</LinkWithEffect>
</div>

<LinkWithEffect
className={styles.title}
href="https://github.com/nervosnetwork/ckb/wiki/Public-JSON-RPC-nodes"
>
{t('Public Node')}
<LinkWithEffect className={styles.title} href="https://status-website-delta.vercel.app">
{t('Service Monitor')}
</LinkWithEffect>

<div className={styles.title}>{t('Language')}</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/status/src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Layout: React.FC<PropsWithChildren> = ({ children }) => {
return (
<>
<Header
navMenuGroupName='Status'
navMenuGroupName='Service Monitor'
navMenus={[
{ name: 'Home', link: '/' },
{ name: 'Index', link: '/stat' },
Expand Down
1 change: 1 addition & 0 deletions packages/status/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// TODO: The two files need to be merged later.
import './globals.css'
import '../styles/globals.scss'
import 'overlayscrollbars/overlayscrollbars.css'
import type { AppProps } from 'next/app'
import { appWithTranslation } from 'next-i18next'
import { api } from '../utils/api'
Expand Down

0 comments on commit c52664d

Please sign in to comment.