From acfe8de26f7245606dc38f00024b0cb7c3201bed Mon Sep 17 00:00:00 2001 From: Jayden Seric Date: Wed, 9 Oct 2019 20:26:37 +1100 Subject: [PATCH] Update examples, and use device-agnostic-ui. --- app/components/Field.js | 13 ---------- app/components/Inset.js | 10 ++++++++ app/components/Page.js | 19 +------------- app/components/Section.js | 16 ++++++------ app/components/Table.js | 44 --------------------------------- app/components/UploadBlob.js | 30 +++++++++++++--------- app/components/UploadFile.js | 2 +- app/components/Uploads.js | 38 +++++++++++++++------------- app/package-lock.json | 10 ++++++++ app/package.json | 1 + app/pages/_app.js | 14 +++++++++++ app/pages/index.js | 44 ++++++++++++++++++++++++++------- app/public/manifest.webmanifest | 4 +-- 13 files changed, 122 insertions(+), 123 deletions(-) delete mode 100644 app/components/Field.js create mode 100644 app/components/Inset.js delete mode 100644 app/components/Table.js diff --git a/app/components/Field.js b/app/components/Field.js deleted file mode 100644 index 17f3c90..0000000 --- a/app/components/Field.js +++ /dev/null @@ -1,13 +0,0 @@ -const Field = ({ children }) => ( - -) - -export default Field diff --git a/app/components/Inset.js b/app/components/Inset.js new file mode 100644 index 0000000..475d7ba --- /dev/null +++ b/app/components/Inset.js @@ -0,0 +1,10 @@ +export const Inset = ({ children }) => ( +
+ {children} + +
+) diff --git a/app/components/Page.js b/app/components/Page.js index da3796b..c26e10b 100644 --- a/app/components/Page.js +++ b/app/components/Page.js @@ -1,27 +1,10 @@ import Head from 'next/head' -const Page = ({ title, children }) => ( +export const Page = ({ title, children }) => (
{title} - - - - - {children} -
) - -export default Page diff --git a/app/components/Section.js b/app/components/Section.js index fb85e50..93ebdeb 100644 --- a/app/components/Section.js +++ b/app/components/Section.js @@ -1,15 +1,15 @@ -const Section = ({ heading, children }) => ( +export const Section = ({ intro, children }) => (
-

{heading}

+
{intro}
{children}
) - -export default Section diff --git a/app/components/Table.js b/app/components/Table.js deleted file mode 100644 index 9634a04..0000000 --- a/app/components/Table.js +++ /dev/null @@ -1,44 +0,0 @@ -export const Table = ({ thead, tbody }) => ( -
- - {thead} - {tbody} -
- -
-) - -export const Head = ({ children }) => ( - - {children} - - -) - -export const Cell = ({ children }) => ( - - {children} - - -) diff --git a/app/components/UploadBlob.js b/app/components/UploadBlob.js index f75898d..1b09c8a 100644 --- a/app/components/UploadBlob.js +++ b/app/components/UploadBlob.js @@ -1,7 +1,7 @@ import { useApolloClient, useMutation } from '@apollo/react-hooks' +import { Button, Code, Fieldset, Textbox } from 'device-agnostic-ui' import gql from 'graphql-tag' import React from 'react' -import Field from './Field' const SINGLE_UPLOAD_MUTATION = gql` mutation singleUpload($file: Upload!) { @@ -14,7 +14,9 @@ const SINGLE_UPLOAD_MUTATION = gql` export const UploadBlob = () => { const [name, setName] = React.useState('') const [content, setContent] = React.useState('') - const [singleUploadMutation] = useMutation(SINGLE_UPLOAD_MUTATION) + const [singleUploadMutation, { loading }] = useMutation( + SINGLE_UPLOAD_MUTATION + ) const apolloClient = useApolloClient() const onNameChange = ({ target: { value } }) => setName(value) @@ -32,24 +34,30 @@ export const UploadBlob = () => { return (
- - + File name (without .txt) + + } + > + {' '} - .txt - - -