diff --git a/resources/scripts/assets/css/GlobalStylesheet.ts b/resources/scripts/assets/css/GlobalStylesheet.ts index 9cdfecfe6..5cc44cea6 100644 --- a/resources/scripts/assets/css/GlobalStylesheet.ts +++ b/resources/scripts/assets/css/GlobalStylesheet.ts @@ -14,4 +14,22 @@ export default createGlobalStyle` p { ${tw`text-neutral-200 leading-snug font-sans`}; } + + form { + ${tw`m-0`}; + } + + textarea, select, input, button, button:focus, button:focus-visible { + ${tw`outline-none`}; + } + + input[type=number]::-webkit-outer-spin-button, + input[type=number]::-webkit-inner-spin-button { + -webkit-appearance: none !important; + margin: 0; + } + + input[type=number] { + -moz-appearance: textfield !important; + } `; diff --git a/resources/scripts/components/dashboard/forms/ConfigureTwoFactorForm.tsx b/resources/scripts/components/dashboard/forms/ConfigureTwoFactorForm.tsx index dc6b467a6..f848b633d 100644 --- a/resources/scripts/components/dashboard/forms/ConfigureTwoFactorForm.tsx +++ b/resources/scripts/components/dashboard/forms/ConfigureTwoFactorForm.tsx @@ -3,6 +3,8 @@ import { useStoreState } from 'easy-peasy'; import { ApplicationStore } from '@/state'; import SetupTwoFactorModal from '@/components/dashboard/forms/SetupTwoFactorModal'; import DisableTwoFactorModal from '@/components/dashboard/forms/DisableTwoFactorModal'; +import tw from 'twin.macro'; +import Button from '@/components/elements/Button'; export default () => { const user = useStoreState((state: ApplicationStore) => state.user.data!); @@ -17,38 +19,40 @@ export default () => { onDismissed={() => setVisible(false)} /> } -

+

Two-factor authentication is currently enabled on your account.

-
- +
:
{visible && setVisible(false)} /> } -

+

You do not currently have two-factor authentication enabled on your account. Click the button below to begin configuring it.

-
- +
; diff --git a/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx b/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx index 2563e1386..547cb26ce 100644 --- a/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx +++ b/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx @@ -6,6 +6,8 @@ import SpinnerOverlay from '@/components/elements/SpinnerOverlay'; import Field from '@/components/elements/Field'; import { httpErrorToHuman } from '@/api/http'; import { ApplicationStore } from '@/state'; +import tw from 'twin.macro'; +import Button from '@/components/elements/Button'; interface Values { email: string; @@ -54,14 +56,14 @@ export default () => { ({ isSubmitting, isValid }) => ( -
+ -
+
{ label={'Confirm Password'} />
-
- +
diff --git a/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx b/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx index 17809b496..e8fe075e2 100644 --- a/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx +++ b/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx @@ -7,6 +7,8 @@ import SpinnerOverlay from '@/components/elements/SpinnerOverlay'; import updateAccountPassword from '@/api/account/updateAccountPassword'; import { httpErrorToHuman } from '@/api/http'; import { ApplicationStore } from '@/state'; +import tw from 'twin.macro'; +import Button from '@/components/elements/Button'; interface Values { current: string; @@ -34,7 +36,6 @@ export default () => { clearFlashes('account:password'); updateAccountPassword({ ...values }) .then(() => { - // @ts-ignore window.location = '/auth/login'; }) .catch(error => addFlash({ @@ -57,14 +58,14 @@ export default () => { ({ isSubmitting, isValid }) => ( -
+ -
+
{ description={'Your new password should be at least 8 characters in length and unique to this website.'} />
-
+
{ label={'Confirm New Password'} />
-
- +
diff --git a/resources/scripts/components/elements/Button.tsx b/resources/scripts/components/elements/Button.tsx index 04bb13a81..1450e2e91 100644 --- a/resources/scripts/components/elements/Button.tsx +++ b/resources/scripts/components/elements/Button.tsx @@ -1,20 +1,97 @@ import React from 'react'; -import classNames from 'classnames'; +import styled, { css } from 'styled-components/macro'; +import tw from 'twin.macro'; -type Props = { isLoading?: boolean } & React.DetailedHTMLProps, HTMLButtonElement>; +interface Props { + isLoading?: boolean; + size?: 'xsmall' | 'small' | 'large' | 'xlarge'; + color?: 'green' | 'red' | 'primary' | 'grey'; + isSecondary?: boolean; + disabled?: boolean; +} -export default ({ isLoading, children, className, ...props }: Props) => ( - + ); + +export default Button; diff --git a/resources/scripts/components/elements/ContentBox.tsx b/resources/scripts/components/elements/ContentBox.tsx index 94c9ad629..4eb777c03 100644 --- a/resources/scripts/components/elements/ContentBox.tsx +++ b/resources/scripts/components/elements/ContentBox.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; -import classNames from 'classnames'; +import React from 'react'; import FlashMessageRender from '@/components/FlashMessageRender'; import SpinnerOverlay from '@/components/elements/SpinnerOverlay'; +import tw from 'twin.macro'; type Props = Readonly, HTMLDivElement> & { title?: string; @@ -12,16 +12,19 @@ type Props = Readonly (
- {title &&

{title}

} + {title &&

{title}

} {showFlashes && } -
+
{children}
diff --git a/resources/scripts/routers/DashboardRouter.tsx b/resources/scripts/routers/DashboardRouter.tsx index f0a78a183..7e8f476a2 100644 --- a/resources/scripts/routers/DashboardRouter.tsx +++ b/resources/scripts/routers/DashboardRouter.tsx @@ -6,17 +6,45 @@ import DashboardContainer from '@/components/dashboard/DashboardContainer'; import TransitionRouter from '@/TransitionRouter'; import AccountApiContainer from '@/components/dashboard/AccountApiContainer'; import NotFound from '@/components/screens/NotFound'; +import styled from 'styled-components/macro'; +import tw from 'twin.macro'; +import config from '@/../../tailwind.config.js'; + +const SubNavigation = styled.div` + ${tw`w-full bg-neutral-700 shadow`}; + + & > div { + ${tw`flex items-center text-sm mx-auto px-2`}; + max-width: 1200px; + + & > a, & > div { + ${tw`inline-block py-3 px-4 text-neutral-300 no-underline transition-all duration-150`}; + + &:not(:first-of-type) { + ${tw`ml-2`}; + } + + &:active, &:hover { + ${tw`text-neutral-100`}; + } + + &:active, &:hover, &.active { + box-shadow: inset 0 -2px ${config.theme.colors.cyan['500']}; + } + } + } +`; export default ({ location }: RouteComponentProps) => ( <> {location.pathname.startsWith('/account') && -
-
+ +
Settings API Credentials
-
+ }