From 5f1be4679e0f06a779f3ecdd3d0f13497527aa5f Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 4 Feb 2022 22:50:13 -0800 Subject: [PATCH] Implement Radix's Dialog component for the About modal. Probably still want to spend some time making this look nice/wordsmithing the copy later. --- components/AboutModal/index.scss | 26 ++++++++++---- components/AboutModal/index.tsx | 59 +++++++++++++++++-------------- components/BottomHeader/index.tsx | 5 --- components/HeaderMenu/index.tsx | 10 ++---- styles/globals.scss | 38 +++++++++++++++++++- 5 files changed, 91 insertions(+), 47 deletions(-) diff --git a/components/AboutModal/index.scss b/components/AboutModal/index.scss index 2a96b969..6661df44 100644 --- a/components/AboutModal/index.scss +++ b/components/AboutModal/index.scss @@ -1,10 +1,22 @@ -.AboutModal p { - font-size: $font-regular; - line-height: 1.24; - margin: 0; - margin-bottom: $unit * 2; +.About.Dialog { + width: $unit * 60; - &:last-of-type { - margin-bottom: 0; + section { + margin-bottom: $unit * 4; + + h2 { + margin-bottom: $unit * 3; + } + } + + .DialogDescription p { + font-size: $font-regular; + line-height: 1.24; + margin: 0; + margin-bottom: $unit * 2; + + &:last-of-type { + margin-bottom: 0; + } } } diff --git a/components/AboutModal/index.tsx b/components/AboutModal/index.tsx index 6c01e75e..9c096f68 100644 --- a/components/AboutModal/index.tsx +++ b/components/AboutModal/index.tsx @@ -1,35 +1,42 @@ import React from 'react' -import { createPortal } from 'react-dom' -import api from '~utils/api' - -import Modal from '~components/Modal' -import Overlay from '~components/Overlay' +import * as Dialog from '@radix-ui/react-dialog' +import CrossIcon from '~public/icons/Cross.svg' import './index.scss' -interface Props { - close: () => void -} - -const AboutModal = (props: Props) => { +const AboutModal = () => { return ( - createPortal( -
- {} } - > -
-

Siero is a tool to save and share parties for Granblue Fantasy.

-

All you need to do to get started is start adding things. Siero will make a URL and you can share your party with the world.

-

If you want to save your parties for safe keeping or to edit them later, you can make a free account.

+ + +
  • About
  • +
    + + event.preventDefault() }> +
    + About + + + + +
    - - -
    , - document.body - ) + +

    Granblue.team is a tool to save and share team compositions for Granblue Fantasy.

    +

    Start adding things to a team and a URL will be created for you to share it wherever you like, no account needed.

    +

    You can make an account to save any teams you find for future reference, or to keep all of your teams together in one place.

    +
    + Credits + +

    Granblue.team was built by @jedmund with a lot of help from @lalalalinna and @tarngerine.

    +
    + Open Source + +

    This app is open source. You can contribute on Github.

    +
    + + + + ) } diff --git a/components/BottomHeader/index.tsx b/components/BottomHeader/index.tsx index 8eca6768..4b1ad77f 100644 --- a/components/BottomHeader/index.tsx +++ b/components/BottomHeader/index.tsx @@ -30,11 +30,6 @@ const BottomHeader = () => { } }, [cookies, setUsername, setAuthenticated]) - function closeModal() { - const escape = new KeyboardEvent('keydown', {'key': 'Escape'}) - document.dispatchEvent(escape) - } - function deleteTeam(event: React.MouseEvent) { // TODO: Implement deleting teams console.log("Deleting team...") diff --git a/components/HeaderMenu/index.tsx b/components/HeaderMenu/index.tsx index 28c84dd8..36481447 100644 --- a/components/HeaderMenu/index.tsx +++ b/components/HeaderMenu/index.tsx @@ -46,10 +46,7 @@ const HeaderMenu = (props: Props) => {
    -
  • About
  • - {aboutOpen ? ( - - ) : null} +
  • Settings
  • Logout
  • @@ -62,10 +59,7 @@ const HeaderMenu = (props: Props) => { return (