mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 08:45:30 +03:00
webui: start reorganizing the component structure
This commit is contained in:
parent
680dd91c0c
commit
8b85780d76
@ -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": [
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
fragment Label on Label {
|
|
||||||
name
|
|
||||||
color {
|
|
||||||
R
|
|
||||||
G
|
|
||||||
B
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
#import "../Label.graphql"
|
#import "../components/fragments.graphql"
|
||||||
#import "../Author.graphql"
|
|
||||||
|
|
||||||
fragment Bug on Bug {
|
fragment Bug on Bug {
|
||||||
id
|
id
|
||||||
|
@ -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';
|
||||||
|
@ -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';
|
||||||
|
@ -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';
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#import "../Author.graphql"
|
#import "../components/fragments.graphql"
|
||||||
#import "../Label.graphql"
|
|
||||||
|
|
||||||
fragment LabelChange on LabelChangeTimelineItem {
|
fragment LabelChange on LabelChangeTimelineItem {
|
||||||
date
|
date
|
||||||
|
@ -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';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#import "../Author.graphql"
|
#import "../components/fragments.graphql"
|
||||||
|
|
||||||
fragment AddComment on AddCommentTimelineItem {
|
fragment AddComment on AddCommentTimelineItem {
|
||||||
createdAt
|
createdAt
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#import "../Author.graphql"
|
#import "../components/fragments.graphql"
|
||||||
|
|
||||||
fragment Create on CreateTimelineItem {
|
fragment Create on CreateTimelineItem {
|
||||||
createdAt
|
createdAt
|
||||||
|
@ -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';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#import "../Author.graphql"
|
#import "../components/fragments.graphql"
|
||||||
|
|
||||||
fragment SetStatus on SetStatusTimelineItem {
|
fragment SetStatus on SetStatusTimelineItem {
|
||||||
date
|
date
|
||||||
|
@ -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';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#import "../Author.graphql"
|
#import "../components/fragments.graphql"
|
||||||
|
|
||||||
fragment SetTitle on SetTitleTimelineItem {
|
fragment SetTitle on SetTitleTimelineItem {
|
||||||
date
|
date
|
||||||
|
@ -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;
|
@ -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) => {
|
@ -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;
|
@ -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
|
@ -1,5 +1,4 @@
|
|||||||
#import "../Author.graphql"
|
#import "../components/fragments.graphql"
|
||||||
#import "../Label.graphql"
|
|
||||||
|
|
||||||
fragment BugRow on Bug {
|
fragment BugRow on Bug {
|
||||||
id
|
id
|
||||||
|
@ -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';
|
||||||
|
Loading…
Reference in New Issue
Block a user