From c6d6221711aa4f7f8ce3966a1f39de253d5d91b1 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 11 Oct 2020 12:29:00 -0700 Subject: [PATCH] Correctly fix the UI for API keys --- .../dashboard/AccountApiContainer.tsx | 34 +++++-------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/resources/scripts/components/dashboard/AccountApiContainer.tsx b/resources/scripts/components/dashboard/AccountApiContainer.tsx index 26533878..d739ea60 100644 --- a/resources/scripts/components/dashboard/AccountApiContainer.tsx +++ b/resources/scripts/components/dashboard/AccountApiContainer.tsx @@ -14,26 +14,8 @@ import { httpErrorToHuman } from '@/api/http'; import { format } from 'date-fns'; import PageContentBlock from '@/components/elements/PageContentBlock'; import tw from 'twin.macro'; -import { breakpoint } from '@/theme'; -import styled from 'styled-components/macro'; import GreyRowBox from '@/components/elements/GreyRowBox'; -const Container = styled.div` - ${tw`flex flex-wrap my-10`}; - - & > div { - ${tw`w-full`}; - - ${breakpoint('md')` - width: calc(50% - 1rem); - `} - - ${breakpoint('xl')` - ${tw`w-auto flex-1`}; - `} - } -`; - export default () => { const [ deleteIdentifier, setDeleteIdentifier ] = useState(''); const [ keys, setKeys ] = useState([]); @@ -67,12 +49,12 @@ export default () => { return ( - - - + +
+ setKeys(s => ([ ...s!, key ]))}/> - + { css={[ tw`bg-neutral-600 flex items-center`, index > 0 && tw`mt-2` ]} > -
-

{key.description}

+
+

{key.description}

Last used:  {key.lastUsedAt ? format(key.lastUsedAt, 'MMM do, yyyy HH:mm') : 'Never'}

-

+

); };