From 093545690677ce3652dc6fa9473eb16eae10e1ab Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Sun, 25 Jul 2021 21:47:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A6=E4=BE=A7=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E6=9C=AA=E5=9B=BA=E5=AE=9A=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/graphql/generated.tsx | 40 +++ commons/graphql/graphql.schema.json | 265 +++++++++++++++++++ components/layouts/global-sidebar.module.css | 6 +- 3 files changed, 308 insertions(+), 3 deletions(-) diff --git a/commons/graphql/generated.tsx b/commons/graphql/generated.tsx index 5906ab1..74f0db2 100644 --- a/commons/graphql/generated.tsx +++ b/commons/graphql/generated.tsx @@ -32,6 +32,10 @@ export type CreateArticleInput = { tags: Array; }; +export type CreateTagInput = { + name: Scalars['String']; +}; + export type Hello = { __typename?: 'Hello'; @@ -43,6 +47,9 @@ export type Mutation = { createArticle: Article; updateArticle: Article; removeArticle: Scalars['Int']; + createTag: Tag; + updateTag: Tag; + removeTag: Tag; }; @@ -60,11 +67,28 @@ export type MutationRemoveArticleArgs = { id: Scalars['String']; }; + +export type MutationCreateTagArgs = { + createTagInput: CreateTagInput; +}; + + +export type MutationUpdateTagArgs = { + updateTagInput: UpdateTagInput; +}; + + +export type MutationRemoveTagArgs = { + id: Scalars['String']; +}; + export type Query = { __typename?: 'Query'; hello: Hello; articles: Array
; article: Article; + tags: Array; + tag: Tag; }; @@ -72,6 +96,17 @@ export type QueryArticleArgs = { id: Scalars['String']; }; + +export type QueryTagArgs = { + id: Scalars['String']; +}; + +export type Tag = { + __typename?: 'Tag'; + id: Scalars['ID']; + name: Scalars['String']; +}; + export type UpdateArticleInput = { title?: Maybe; content?: Maybe; @@ -79,3 +114,8 @@ export type UpdateArticleInput = { tags?: Maybe>; id: Scalars['String']; }; + +export type UpdateTagInput = { + name?: Maybe; + id: Scalars['String']; +}; diff --git a/commons/graphql/graphql.schema.json b/commons/graphql/graphql.schema.json index 572ffa2..dc4a7f8 100644 --- a/commons/graphql/graphql.schema.json +++ b/commons/graphql/graphql.schema.json @@ -230,6 +230,33 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "CreateTagInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "name", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "SCALAR", "name": "DateTime", @@ -370,6 +397,105 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "createTag", + "description": null, + "args": [ + { + "name": "createTagInput", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CreateTagInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Tag", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateTag", + "description": null, + "args": [ + { + "name": "updateTagInput", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateTagInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Tag", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "removeTag", + "description": null, + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Tag", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -464,6 +590,106 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "tags", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Tag", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "tag", + "description": null, + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Tag", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Tag", + "description": null, + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -554,6 +780,45 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateTagInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "name", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "SCALAR", "name": "Boolean", diff --git a/components/layouts/global-sidebar.module.css b/components/layouts/global-sidebar.module.css index 8e89b0c..b6476ae 100644 --- a/components/layouts/global-sidebar.module.css +++ b/components/layouts/global-sidebar.module.css @@ -1,13 +1,13 @@ .wrapper { @apply bg-green-400 text-white min-h-screen; - @apply absolute top-0 left-0 right-0 bottom-0 sm:static; - @apply -translate-x-full transform transition-transform sm:transition-none sm:translate-x-0; + @apply fixed top-0 sm:left-0 right-0 bottom-0 sm:static -left-full; + @apply transition-all; :global(.dark) & { @apply bg-gray-800 text-gray-400; } &.focusOpen { - @apply translate-x-0; + @apply left-0; } } .sidebar {