webui: start reorganizing the component structure

This commit is contained in:
Quentin Gliech 2020-02-13 00:53:29 +01:00
parent 680dd91c0c
commit 8b85780d76
No known key found for this signature in database
GPG Key ID: 22D62B84552719FC
23 changed files with 41 additions and 41 deletions

View File

@ -49,7 +49,8 @@
"test": "react-scripts test --env=jsdom", "test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject", "eject": "react-scripts eject",
"generate": "graphql-codegen", "generate": "graphql-codegen",
"lint": "eslint src --ext .ts --ext .tsx --ext .js --ext .jsx --ext .graphql" "lint": "eslint src --ext .ts --ext .tsx --ext .js --ext .jsx --ext .graphql",
"clean": "rimraf src/**.generated.* src/schema.json src/gqlTypes.* src/fragmentTypes.*"
}, },
"proxy": "http://localhost:3001", "proxy": "http://localhost:3001",
"browserslist": [ "browserslist": [

View File

@ -1,8 +0,0 @@
fragment Label on Label {
name
color {
R
G
B
}
}

View File

@ -1,5 +1,4 @@
#import "../Label.graphql" #import "../components/fragments.graphql"
#import "../Author.graphql"
fragment Bug on Bug { fragment Bug on Bug {
id id

View File

@ -2,9 +2,9 @@ import Typography from '@material-ui/core/Typography/Typography';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import React from 'react'; import React from 'react';
import Author from '../Author'; import Author from '../components/Author';
import Date from '../Date'; import Date from '../components/Date';
import Label from '../Label'; import Label from '../components/Label';
import { BugFragment } from './Bug.generated'; import { BugFragment } from './Bug.generated';
import CommentForm from './CommentForm'; import CommentForm from './CommentForm';

View File

@ -6,7 +6,7 @@ import TextField from '@material-ui/core/TextField';
import { makeStyles, Theme } from '@material-ui/core/styles'; import { makeStyles, Theme } from '@material-ui/core/styles';
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import Content from '../Content'; import Content from '../components/Content';
import { useAddCommentMutation } from './CommentForm.generated'; import { useAddCommentMutation } from './CommentForm.generated';
import { TimelineDocument } from './TimelineQuery.generated'; import { TimelineDocument } from './TimelineQuery.generated';

View File

@ -1,9 +1,9 @@
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import React from 'react'; import React from 'react';
import Author from '../Author'; import Author from '../components/Author';
import Date from '../Date'; import Date from '../components/Date';
import Label from '../Label'; import Label from '../components/Label';
import { LabelChangeFragment } from './LabelChangeFragment.generated'; import { LabelChangeFragment } from './LabelChangeFragment.generated';

View File

@ -1,5 +1,4 @@
#import "../Author.graphql" #import "../components/fragments.graphql"
#import "../Label.graphql"
fragment LabelChange on LabelChangeTimelineItem { fragment LabelChange on LabelChangeTimelineItem {
date date

View File

@ -2,10 +2,9 @@ import Paper from '@material-ui/core/Paper';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import React from 'react'; import React from 'react';
import Author from '../Author'; import Author, { Avatar } from '../components/Author';
import { Avatar } from '../Author'; import Date from '../components/Date';
import Content from '../Content'; import Content from '../components/Content';
import Date from '../Date';
import { AddCommentFragment } from './MessageCommentFragment.generated'; import { AddCommentFragment } from './MessageCommentFragment.generated';
import { CreateFragment } from './MessageCreateFragment.generated'; import { CreateFragment } from './MessageCreateFragment.generated';

View File

@ -1,4 +1,4 @@
#import "../Author.graphql" #import "../components/fragments.graphql"
fragment AddComment on AddCommentTimelineItem { fragment AddComment on AddCommentTimelineItem {
createdAt createdAt

View File

@ -1,4 +1,4 @@
#import "../Author.graphql" #import "../components/fragments.graphql"
fragment Create on CreateTimelineItem { fragment Create on CreateTimelineItem {
createdAt createdAt

View File

@ -1,8 +1,8 @@
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import React from 'react'; import React from 'react';
import Author from '../Author'; import Author from '../components/Author';
import Date from '../Date'; import Date from '../components/Date';
import { SetStatusFragment } from './SetStatusFragment.generated'; import { SetStatusFragment } from './SetStatusFragment.generated';

View File

@ -1,4 +1,4 @@
#import "../Author.graphql" #import "../components/fragments.graphql"
fragment SetStatus on SetStatusTimelineItem { fragment SetStatus on SetStatusTimelineItem {
date date

View File

@ -1,8 +1,8 @@
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import React from 'react'; import React from 'react';
import Author from '../Author'; import Author from '../components/Author';
import Date from '../Date'; import Date from '../components/Date';
import { SetTitleFragment } from './SetTitleFragment.generated'; import { SetTitleFragment } from './SetTitleFragment.generated';

View File

@ -1,4 +1,4 @@
#import "../Author.graphql" #import "../components/fragments.graphql"
fragment SetTitle on SetTitleTimelineItem { fragment SetTitle on SetTitleTimelineItem {
date date

View File

@ -2,7 +2,7 @@ import MAvatar from '@material-ui/core/Avatar';
import Tooltip from '@material-ui/core/Tooltip/Tooltip'; import Tooltip from '@material-ui/core/Tooltip/Tooltip';
import React from 'react'; import React from 'react';
import { AuthoredFragment } from './Author.generated'; import { AuthoredFragment } from './fragments.generated';
type Props = AuthoredFragment & { type Props = AuthoredFragment & {
className?: string; className?: string;

View File

@ -4,8 +4,8 @@ import parse from 'remark-parse';
import remark2react from 'remark-react'; import remark2react from 'remark-react';
import unified from 'unified'; import unified from 'unified';
import ImageTag from './tag/ImageTag'; import ImageTag from './ImageTag';
import PreTag from './tag/PreTag'; import PreTag from './PreTag';
type Props = { markdown: string }; type Props = { markdown: string };
const Content: React.FC<Props> = ({ markdown }: Props) => { const Content: React.FC<Props> = ({ markdown }: Props) => {

View File

@ -6,8 +6,8 @@ import {
} from '@material-ui/core/styles/colorManipulator'; } from '@material-ui/core/styles/colorManipulator';
import React from 'react'; import React from 'react';
import { LabelFragment } from './Label.generated'; import { LabelFragment } from './fragments.generated';
import { Color } from './gqlTypes'; import { Color } from '../gqlTypes';
// Minimum contrast between the background and the text color // Minimum contrast between the background and the text color
const contrastThreshold = 2.5; const contrastThreshold = 2.5;

View File

@ -1,3 +1,14 @@
# Label.tsx
fragment Label on Label {
name
color {
R
G
B
}
}
# Author.tsx
fragment authored on Authored { fragment authored on Authored {
author { author {
name name

View File

@ -1,5 +1,4 @@
#import "../Author.graphql" #import "../components/fragments.graphql"
#import "../Label.graphql"
fragment BugRow on Bug { fragment BugRow on Bug {
id id

View File

@ -7,8 +7,8 @@ import ErrorOutline from '@material-ui/icons/ErrorOutline';
import React from 'react'; import React from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import Date from '../Date'; import Date from '../components/Date';
import Label from '../Label'; import Label from '../components/Label';
import { Status } from '../gqlTypes'; import { Status } from '../gqlTypes';
import { BugRowFragment } from './BugRow.generated'; import { BugRowFragment } from './BugRow.generated';