diff --git a/src/pages/Prototype/index.tsx b/src/pages/Prototype/index.tsx index ca2f344..6421e2f 100644 --- a/src/pages/Prototype/index.tsx +++ b/src/pages/Prototype/index.tsx @@ -3,7 +3,7 @@ import { useHistory, useParams } from 'react-router-dom'; import { useLazyQuery, useReactiveVar } from '@apollo/client'; import { Redirect } from 'react-router'; import { roleVar } from '../../graphql/state'; -import { Empty, ArrowLeft } from '../../assets'; +import { Empty, ArrowLeft, Edit, Check } from '../../assets'; import { Box, Text, @@ -19,12 +19,14 @@ import { TemplateOutput, } from '../../graphql/types'; import { GET_TEMPLATE_BY_ID } from '../../graphql/template.api'; +import { theme } from '../../themes'; const Prototype = () => { const role = useReactiveVar(roleVar); const history = useHistory(); const { id } = useParams<{ id: string }>(); const [template, setTemplate] = useState(); + const [editing, setEditing] = useState(false); const [getTemplate, { loading: templateLoading }] = useLazyQuery< GetTemplateByIdQuery, @@ -49,7 +51,7 @@ const Prototype = () => { {!templateLoading ? ( <> {template ? ( - + { - {template.features.map((feature) => { + {template.features.map((feature, index) => { if ( feature.featureType === 'frontend' || feature.featureType === 'fullstack' ) { - return ; + return ( + + ); } return null; })} + setEditing(!editing)} + > + {!editing ? : } + { feature.featureType === 'backend' || feature.featureType === 'fullstack' ) { - return ; + return ( + + ); } return null; })} diff --git a/src/pages/Prototype/styles.ts b/src/pages/Prototype/styles.ts index bf7ee3d..9ccd12b 100644 --- a/src/pages/Prototype/styles.ts +++ b/src/pages/Prototype/styles.ts @@ -9,4 +9,21 @@ export const Wrapper = styled.div` fill: ${({ theme, color }) => color ? theme.colors[color].main : theme.colors.client.main}; } + + .frontend-feature-odd { + justify-self: flex-end; + } + + .frontend-feature-even { + justify-self: flex-start; + } + + .frontend-feature-even, + .frontend-feature-odd { + &:hover { + border: 2px solid + ${({ theme, color }) => + color ? theme.colors[color].main : theme.colors.client.main}; + } + } `;