fix: 左侧边栏未固定的问题

This commit is contained in:
Ivan Li 2021-07-25 21:47:25 +08:00
parent a1282c43b4
commit 0935456906
3 changed files with 308 additions and 3 deletions

View File

@ -32,6 +32,10 @@ export type CreateArticleInput = {
tags: Array<Scalars['String']>; tags: Array<Scalars['String']>;
}; };
export type CreateTagInput = {
name: Scalars['String'];
};
export type Hello = { export type Hello = {
__typename?: 'Hello'; __typename?: 'Hello';
@ -43,6 +47,9 @@ export type Mutation = {
createArticle: Article; createArticle: Article;
updateArticle: Article; updateArticle: Article;
removeArticle: Scalars['Int']; removeArticle: Scalars['Int'];
createTag: Tag;
updateTag: Tag;
removeTag: Tag;
}; };
@ -60,11 +67,28 @@ export type MutationRemoveArticleArgs = {
id: Scalars['String']; id: Scalars['String'];
}; };
export type MutationCreateTagArgs = {
createTagInput: CreateTagInput;
};
export type MutationUpdateTagArgs = {
updateTagInput: UpdateTagInput;
};
export type MutationRemoveTagArgs = {
id: Scalars['String'];
};
export type Query = { export type Query = {
__typename?: 'Query'; __typename?: 'Query';
hello: Hello; hello: Hello;
articles: Array<Article>; articles: Array<Article>;
article: Article; article: Article;
tags: Array<Tag>;
tag: Tag;
}; };
@ -72,6 +96,17 @@ export type QueryArticleArgs = {
id: Scalars['String']; id: Scalars['String'];
}; };
export type QueryTagArgs = {
id: Scalars['String'];
};
export type Tag = {
__typename?: 'Tag';
id: Scalars['ID'];
name: Scalars['String'];
};
export type UpdateArticleInput = { export type UpdateArticleInput = {
title?: Maybe<Scalars['String']>; title?: Maybe<Scalars['String']>;
content?: Maybe<Scalars['String']>; content?: Maybe<Scalars['String']>;
@ -79,3 +114,8 @@ export type UpdateArticleInput = {
tags?: Maybe<Array<Scalars['String']>>; tags?: Maybe<Array<Scalars['String']>>;
id: Scalars['String']; id: Scalars['String'];
}; };
export type UpdateTagInput = {
name?: Maybe<Scalars['String']>;
id: Scalars['String'];
};

View File

@ -230,6 +230,33 @@
"enumValues": null, "enumValues": null,
"possibleTypes": 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", "kind": "SCALAR",
"name": "DateTime", "name": "DateTime",
@ -370,6 +397,105 @@
}, },
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "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, "inputFields": null,
@ -464,6 +590,106 @@
}, },
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "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, "inputFields": null,
@ -554,6 +780,45 @@
"enumValues": null, "enumValues": null,
"possibleTypes": 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", "kind": "SCALAR",
"name": "Boolean", "name": "Boolean",

View File

@ -1,13 +1,13 @@
.wrapper { .wrapper {
@apply bg-green-400 text-white min-h-screen; @apply bg-green-400 text-white min-h-screen;
@apply absolute top-0 left-0 right-0 bottom-0 sm:static; @apply fixed top-0 sm:left-0 right-0 bottom-0 sm:static -left-full;
@apply -translate-x-full transform transition-transform sm:transition-none sm:translate-x-0; @apply transition-all;
:global(.dark) & { :global(.dark) & {
@apply bg-gray-800 text-gray-400; @apply bg-gray-800 text-gray-400;
} }
&.focusOpen { &.focusOpen {
@apply translate-x-0; @apply left-0;
} }
} }
.sidebar { .sidebar {