-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from Magickbase/add_hedaer_service_links
feat: add header service links
- Loading branch information
Showing
14 changed files
with
144 additions
and
73 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' | ||
|
||
|
@@ -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 ( | ||
|
@@ -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 | ||
|
@@ -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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
right: 0; | ||
top: 0; | ||
bottom: 0; | ||
z-index: 1; | ||
} | ||
|
||
.motion { | ||
|
25 changes: 25 additions & 0 deletions
25
packages/magickbase/src/components/Tooltip/index.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters