add parts data
This commit is contained in:
@@ -12,13 +12,17 @@ import { Router, Route } from '@redwoodjs/router'
|
||||
const Routes = () => {
|
||||
return (
|
||||
<Router>
|
||||
<Route path="/parts/new" page={NewPartPage} name="newPart" />
|
||||
<Route path="/parts/{id:Int}/edit" page={EditPartPage} name="editPart" />
|
||||
<Route path="/parts/{id:Int}" page={PartPage} name="part" />
|
||||
<Route path="/parts" page={PartsPage} name="parts" />
|
||||
<Route path="/blog-post/{id:Int}" page={BlogPostPage} name="blogPost" />
|
||||
<Route path="/posts/new" page={NewPostPage} name="newPost" />
|
||||
<Route path="/posts/{id:Int}/edit" page={EditPostPage} name="editPost" />
|
||||
<Route path="/posts/{id:Int}" page={PostPage} name="post" />
|
||||
<Route path="/posts" page={PostsPage} name="posts" />
|
||||
<Route path="/about" page={AboutPage} name="about" />
|
||||
<Route path="/" page={HomePage} name="home" />
|
||||
<Route path="/" page={PartsPage} name="home" />
|
||||
<Route notfound page={NotFoundPage} />
|
||||
</Router>
|
||||
)
|
||||
|
||||
Submodule web/src/cascade updated: b536e6a09a...e634591e27
51
web/src/components/EditPartCell/EditPartCell.js
Normal file
51
web/src/components/EditPartCell/EditPartCell.js
Normal file
@@ -0,0 +1,51 @@
|
||||
import { useMutation, useFlash } from '@redwoodjs/web'
|
||||
import { navigate, routes } from '@redwoodjs/router'
|
||||
import PartForm from 'src/components/PartForm'
|
||||
|
||||
export const QUERY = gql`
|
||||
query FIND_PART_BY_ID($id: Int!) {
|
||||
part: part(id: $id) {
|
||||
id
|
||||
title
|
||||
description
|
||||
code
|
||||
mainImage
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`
|
||||
const UPDATE_PART_MUTATION = gql`
|
||||
mutation UpdatePartMutation($id: Int!, $input: UpdatePartInput!) {
|
||||
updatePart(id: $id, input: $input) {
|
||||
id
|
||||
code
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const Loading = () => <div>Loading...</div>
|
||||
|
||||
export const Success = ({ part }) => {
|
||||
const { addMessage } = useFlash()
|
||||
const [updatePart, { loading, error }] = useMutation(UPDATE_PART_MUTATION, {
|
||||
onCompleted: () => {
|
||||
navigate(routes.parts())
|
||||
addMessage('Part updated.', { classes: 'rw-flash-success' })
|
||||
},
|
||||
})
|
||||
|
||||
const onSave = (input, id) => {
|
||||
updatePart({ variables: { id, input } })
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="rw-segment">
|
||||
<header className="rw-segment-header">
|
||||
<h2 className="rw-heading rw-heading-secondary">Edit Part {part.id}</h2>
|
||||
</header>
|
||||
<div className="rw-segment-main">
|
||||
<PartForm part={part} onSave={onSave} error={error} loading={loading} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
38
web/src/components/NewPart/NewPart.js
Normal file
38
web/src/components/NewPart/NewPart.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import { useMutation, useFlash } from '@redwoodjs/web'
|
||||
import { navigate, routes } from '@redwoodjs/router'
|
||||
import PartForm from 'src/components/PartForm'
|
||||
|
||||
const CREATE_PART_MUTATION = gql`
|
||||
mutation CreatePartMutation($input: CreatePartInput!) {
|
||||
createPart(input: $input) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const NewPart = () => {
|
||||
const { addMessage } = useFlash()
|
||||
const [createPart, { loading, error }] = useMutation(CREATE_PART_MUTATION, {
|
||||
onCompleted: () => {
|
||||
navigate(routes.parts())
|
||||
addMessage('Part created.', { classes: 'rw-flash-success' })
|
||||
},
|
||||
})
|
||||
|
||||
const onSave = (input) => {
|
||||
createPart({ variables: { input } })
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="rw-segment">
|
||||
<header className="rw-segment-header">
|
||||
<h2 className="rw-heading rw-heading-secondary">New Part</h2>
|
||||
</header>
|
||||
<div className="rw-segment-main">
|
||||
<PartForm onSave={onSave} loading={loading} error={error} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default NewPart
|
||||
110
web/src/components/Part/Part.js
Normal file
110
web/src/components/Part/Part.js
Normal file
@@ -0,0 +1,110 @@
|
||||
import { useMutation, useFlash } from '@redwoodjs/web'
|
||||
import { Link, routes, navigate } from '@redwoodjs/router'
|
||||
import { initialize } from 'src/cascade/js/MainPage/CascadeMain'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
const DELETE_PART_MUTATION = gql`
|
||||
mutation DeletePartMutation($id: Int!) {
|
||||
deletePart(id: $id) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const Part = ({ part, saveCode, loading, error}) => {
|
||||
const [code, setCode] = useState(part.code)
|
||||
useEffect(() => {
|
||||
const sickCallback = (code) => setCode(code)
|
||||
initialize(sickCallback, part.code)
|
||||
}, [])
|
||||
const hasChanges = code !== part.code
|
||||
const { addMessage } = useFlash()
|
||||
const [deletePart] = useMutation(DELETE_PART_MUTATION, {
|
||||
onCompleted: () => {
|
||||
navigate(routes.parts())
|
||||
addMessage('Part deleted.', { classes: 'rw-flash-success' })
|
||||
},
|
||||
})
|
||||
|
||||
const onDeleteClick = (id) => {
|
||||
if (confirm('Are you sure you want to delete part ' + id + '?')) {
|
||||
deletePart({ variables: { id } })
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="rw-segment">
|
||||
<header className="rw-segment-header">
|
||||
<h2 className="rw-heading rw-heading-secondary">
|
||||
Part {part.id} Detail
|
||||
</h2>
|
||||
</header>
|
||||
<table className="rw-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<td>{part.title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<td>{part.description}</td>
|
||||
</tr>
|
||||
{/* <tr>
|
||||
<th>Code</th>
|
||||
<td>{part.code}</td>
|
||||
</tr> */}
|
||||
{/* <tr>
|
||||
<th>Main image</th>
|
||||
<td>{part.mainImage}</td>
|
||||
</tr> */}
|
||||
{/* <tr>
|
||||
<th>Created at</th>
|
||||
<td>{timeTag(part.createdAt)}</td>
|
||||
</tr> */}
|
||||
</tbody>
|
||||
</table>
|
||||
<img src={part.mainImage} />
|
||||
</div>
|
||||
<nav className="rw-button-group">
|
||||
{loading && 'Loading...'}
|
||||
{hasChanges && !loading && <button onClick={() => saveCode({code}, part.id)} className="rw-button rw-button-blue">
|
||||
Save Changes
|
||||
</button>}
|
||||
</nav>
|
||||
<div>
|
||||
<div id="topnav" className="topnav">
|
||||
<a href="https://github.com/zalo/CascadeStudio">Cascade Studio 0.0.6</a>
|
||||
<a href="#" id="main-proj-button" title="Sets this project to save in local storage." onClick={() => makeMainProject()}>Make Main Project</a>
|
||||
<a href="#" title="Save Project to .json" onClick={() => saveProject()}>Save Project</a>
|
||||
<label htmlFor="project-file" title="Load Project from .json">Load Project
|
||||
<input
|
||||
id="project-file"
|
||||
name="project-file"
|
||||
type="file"
|
||||
accept=".json"
|
||||
style={{display:'none'}}
|
||||
onInput={() => loadProject()}
|
||||
/>
|
||||
</label>
|
||||
<a href="#" onClick={() => threejsViewport.saveShapeSTEP()}>Save STEP</a>
|
||||
<a href="#" onClick={() => threejsViewport.saveShapeSTL()}>Save STL</a>
|
||||
<a href="#" onClick={() => threejsViewport.saveShapeOBJ()}>Save OBJ</a>
|
||||
<label htmlFor="files" title="Import STEP, IGES, or (ASCII) STL from File">Import STEP/IGES/STL
|
||||
<input id="files" name="files" type="file" accept=".iges,.step,.igs,.stp,.stl" multiple style={{display: 'none'}} onInput={ () =>loadFiles()}/>
|
||||
</label>
|
||||
<a href="#" title="Clears the external step/iges/stl files stored in the project." onClick={() => clearExternalFiles()}>Clear Imported Files</a>
|
||||
<a href="" title="Resets the project and localstorage." onClick={() => {
|
||||
window.localStorage.clear();
|
||||
window.history.replaceState({}, 'Cascade Studio','?')
|
||||
}}>Reset Project</a>
|
||||
</div>
|
||||
<div id="cascade-container" style={{height:'auto'}}>
|
||||
</div>
|
||||
<footer>footer</footer>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Part
|
||||
46
web/src/components/PartCell/PartCell.js
Normal file
46
web/src/components/PartCell/PartCell.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import { useMutation, useFlash } from '@redwoodjs/web'
|
||||
import { navigate, routes } from '@redwoodjs/router'
|
||||
import Part from 'src/components/Part'
|
||||
|
||||
export const QUERY = gql`
|
||||
query FIND_PART_BY_ID($id: Int!) {
|
||||
part: part(id: $id) {
|
||||
id
|
||||
title
|
||||
description
|
||||
code
|
||||
mainImage
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const UPDATE_PART_MUTATION = gql`
|
||||
mutation UpdatePartMutation($id: Int!, $input: UpdatePartInput!) {
|
||||
updatePart(id: $id, input: $input) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const Loading = () => <div>Loading...</div>
|
||||
|
||||
export const Empty = () => <div>Part not found</div>
|
||||
|
||||
export const Success = ({ part }) => {
|
||||
const { addMessage } = useFlash()
|
||||
const [updatePart, { loading, error }] = useMutation(UPDATE_PART_MUTATION, {
|
||||
onCompleted: () => {
|
||||
// navigate(routes.part({id: updatePart.id}))
|
||||
addMessage('Part updated.', { classes: 'rw-flash-success' })
|
||||
},
|
||||
})
|
||||
console.log({updatePart})
|
||||
|
||||
|
||||
const saveCode = (input, id) => {
|
||||
console.log(id, input, 'wowow')
|
||||
updatePart({ variables: { id, input } })
|
||||
}
|
||||
return <Part part={{...part, code: part.code}} saveCode={saveCode} loading={loading} error={error} />
|
||||
}
|
||||
100
web/src/components/PartForm/PartForm.js
Normal file
100
web/src/components/PartForm/PartForm.js
Normal file
@@ -0,0 +1,100 @@
|
||||
import {
|
||||
Form,
|
||||
FormError,
|
||||
FieldError,
|
||||
Label,
|
||||
TextField,
|
||||
TextAreaField,
|
||||
Submit,
|
||||
} from '@redwoodjs/forms'
|
||||
|
||||
const PartForm = (props) => {
|
||||
const onSubmit = (data) => {
|
||||
props.onSave(data, props?.part?.id)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="rw-form-wrapper">
|
||||
<Form onSubmit={onSubmit} error={props.error}>
|
||||
<FormError
|
||||
error={props.error}
|
||||
wrapperClassName="rw-form-error-wrapper"
|
||||
titleClassName="rw-form-error-title"
|
||||
listClassName="rw-form-error-list"
|
||||
/>
|
||||
|
||||
<Label
|
||||
name="title"
|
||||
className="rw-label"
|
||||
errorClassName="rw-label rw-label-error"
|
||||
>
|
||||
Title
|
||||
</Label>
|
||||
<TextField
|
||||
name="title"
|
||||
defaultValue={props.part?.title}
|
||||
className="rw-input"
|
||||
errorClassName="rw-input rw-input-error"
|
||||
validation={{ required: true }}
|
||||
/>
|
||||
<FieldError name="title" className="rw-field-error" />
|
||||
|
||||
<Label
|
||||
name="description"
|
||||
className="rw-label"
|
||||
errorClassName="rw-label rw-label-error"
|
||||
>
|
||||
Description
|
||||
</Label>
|
||||
<TextField
|
||||
name="description"
|
||||
defaultValue={props.part?.description}
|
||||
className="rw-input"
|
||||
errorClassName="rw-input rw-input-error"
|
||||
validation={{ required: true }}
|
||||
/>
|
||||
<FieldError name="description" className="rw-field-error" />
|
||||
|
||||
<Label
|
||||
name="code"
|
||||
className="rw-label"
|
||||
errorClassName="rw-label rw-label-error"
|
||||
>
|
||||
Code
|
||||
</Label>
|
||||
<TextAreaField
|
||||
name="code"
|
||||
defaultValue={props.part?.code}
|
||||
className="rw-input"
|
||||
errorClassName="rw-input rw-input-error"
|
||||
validation={{ required: false }}
|
||||
/>
|
||||
<FieldError name="code" className="rw-field-error" />
|
||||
|
||||
<Label
|
||||
name="mainImage"
|
||||
className="rw-label"
|
||||
errorClassName="rw-label rw-label-error"
|
||||
>
|
||||
Main image
|
||||
</Label>
|
||||
<TextField
|
||||
name="mainImage"
|
||||
defaultValue={props.part?.mainImage}
|
||||
className="rw-input"
|
||||
errorClassName="rw-input rw-input-error"
|
||||
validation={{ required: false }}
|
||||
/>
|
||||
<FieldError name="mainImage" className="rw-field-error" />
|
||||
|
||||
<div className="rw-button-group">
|
||||
<Submit disabled={props.loading} className="rw-button rw-button-blue">
|
||||
Save
|
||||
</Submit>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default PartForm
|
||||
109
web/src/components/Parts/Parts.js
Normal file
109
web/src/components/Parts/Parts.js
Normal file
@@ -0,0 +1,109 @@
|
||||
import { useMutation, useFlash } from '@redwoodjs/web'
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
|
||||
const DELETE_PART_MUTATION = gql`
|
||||
mutation DeletePartMutation($id: Int!) {
|
||||
deletePart(id: $id) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const MAX_STRING_LENGTH = 150
|
||||
|
||||
const truncate = (text) => {
|
||||
let output = text
|
||||
if (text && text.length > MAX_STRING_LENGTH) {
|
||||
output = output.substring(0, MAX_STRING_LENGTH) + '...'
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
const jsonTruncate = (obj) => {
|
||||
return truncate(JSON.stringify(obj, null, 2))
|
||||
}
|
||||
|
||||
const timeTag = (datetime) => {
|
||||
return (
|
||||
<time dateTime={datetime} title={datetime}>
|
||||
{new Date(datetime).toUTCString()}
|
||||
</time>
|
||||
)
|
||||
}
|
||||
|
||||
const checkboxInputTag = (checked) => {
|
||||
return <input type="checkbox" checked={checked} disabled />
|
||||
}
|
||||
|
||||
const PartsList = ({ parts }) => {
|
||||
const { addMessage } = useFlash()
|
||||
const [deletePart] = useMutation(DELETE_PART_MUTATION, {
|
||||
onCompleted: () => {
|
||||
addMessage('Part deleted.', { classes: 'rw-flash-success' })
|
||||
},
|
||||
})
|
||||
|
||||
const onDeleteClick = (id) => {
|
||||
if (confirm('Are you sure you want to delete part ' + id + '?')) {
|
||||
deletePart({ variables: { id }, refetchQueries: ['PARTS'] })
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="rw-segment rw-table-wrapper-responsive">
|
||||
<table className="rw-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Title</th>
|
||||
<th>Description</th>
|
||||
<th>Code</th>
|
||||
<th>Main image</th>
|
||||
<th>Created at</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{parts.map((part) => (
|
||||
<tr key={part.id}>
|
||||
<td>{truncate(part.id)}</td>
|
||||
<td>{truncate(part.title)}</td>
|
||||
<td>{truncate(part.description)}</td>
|
||||
<td>{truncate(part.code)}</td>
|
||||
<td>{truncate(part.mainImage)}</td>
|
||||
<td>{timeTag(part.createdAt)}</td>
|
||||
<td>
|
||||
<nav className="rw-table-actions">
|
||||
<Link
|
||||
to={routes.part({ id: part.id })}
|
||||
title={'Show part ' + part.id + ' detail'}
|
||||
className="rw-button rw-button-small"
|
||||
>
|
||||
Show
|
||||
</Link>
|
||||
<Link
|
||||
to={routes.editPart({ id: part.id })}
|
||||
title={'Edit part ' + part.id}
|
||||
className="rw-button rw-button-small rw-button-blue"
|
||||
>
|
||||
Edit
|
||||
</Link>
|
||||
<a
|
||||
href="#"
|
||||
title={'Delete part ' + part.id}
|
||||
className="rw-button rw-button-small rw-button-red"
|
||||
onClick={() => onDeleteClick(part.id)}
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
</nav>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default PartsList
|
||||
33
web/src/components/PartsCell/PartsCell.js
Normal file
33
web/src/components/PartsCell/PartsCell.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
|
||||
import Parts from 'src/components/Parts'
|
||||
|
||||
export const QUERY = gql`
|
||||
query PARTS {
|
||||
parts {
|
||||
id
|
||||
title
|
||||
description
|
||||
code
|
||||
mainImage
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const Loading = () => <div>Loading...</div>
|
||||
|
||||
export const Empty = () => {
|
||||
return (
|
||||
<div className="rw-text-center">
|
||||
{'No parts yet. '}
|
||||
<Link to={routes.newPart()} className="rw-link">
|
||||
{'Create one?'}
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export const Success = ({ parts }) => {
|
||||
return <Parts parts={parts} />
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
// Begins loading the CAD Kernel Web Worker
|
||||
if (window.Worker) {
|
||||
cascadeStudioWorker = new Worker('./src/cascade/js/CADWorker/CascadeStudioMainWorker.js');
|
||||
cascadeStudioWorker = new Worker('/src/cascade/js/CADWorker/CascadeStudioMainWorker.js');
|
||||
// Ping Pong Messages Back and Forth based on their registration in messageHandlers
|
||||
// var messageHandlers = {};
|
||||
cascadeStudioWorker.onmessage = function (e) {
|
||||
|
||||
26
web/src/layouts/MainLayout/MainLayout.js
Normal file
26
web/src/layouts/MainLayout/MainLayout.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
|
||||
const MainLayout = ({ children }) => {
|
||||
return (
|
||||
<>
|
||||
<header>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<Link to={routes.about()}>About</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to={routes.home()}>Home</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to={routes.parts()}>Parts</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<main>{children}</main>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default MainLayout
|
||||
7
web/src/layouts/MainLayout/MainLayout.stories.js
Normal file
7
web/src/layouts/MainLayout/MainLayout.stories.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import MainLayout from './MainLayout'
|
||||
|
||||
export const generated = () => {
|
||||
return <MainLayout />
|
||||
}
|
||||
|
||||
export default { title: 'Layouts/MainLayout' }
|
||||
11
web/src/layouts/MainLayout/MainLayout.test.js
Normal file
11
web/src/layouts/MainLayout/MainLayout.test.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { render } from '@redwoodjs/testing'
|
||||
|
||||
import MainLayout from './MainLayout'
|
||||
|
||||
describe('MainLayout', () => {
|
||||
it('renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<MainLayout />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
23
web/src/layouts/PartsLayout/PartsLayout.js
Normal file
23
web/src/layouts/PartsLayout/PartsLayout.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
import { Flash } from '@redwoodjs/web'
|
||||
|
||||
const PartsLayout = (props) => {
|
||||
return (
|
||||
<div className="rw-scaffold">
|
||||
<Flash timeout={1000} />
|
||||
<header className="rw-header">
|
||||
<h1 className="rw-heading rw-heading-primary">
|
||||
<Link to={routes.parts()} className="rw-link">
|
||||
Parts
|
||||
</Link>
|
||||
</h1>
|
||||
<Link to={routes.newPart()} className="rw-button rw-button-green">
|
||||
<div className="rw-button-icon">+</div> New Part
|
||||
</Link>
|
||||
</header>
|
||||
<main className="rw-main">{props.children}</main>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default PartsLayout
|
||||
12
web/src/pages/EditPartPage/EditPartPage.js
Normal file
12
web/src/pages/EditPartPage/EditPartPage.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import PartsLayout from 'src/layouts/PartsLayout'
|
||||
import EditPartCell from 'src/components/EditPartCell'
|
||||
|
||||
const EditPartPage = ({ id }) => {
|
||||
return (
|
||||
<PartsLayout>
|
||||
<EditPartCell id={id} />
|
||||
</PartsLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditPartPage
|
||||
@@ -1,4 +1,4 @@
|
||||
import BlogLayout from 'src/layouts/BlogLayout'
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import BlogPostsCell from 'src/components/BlogPostsCell'
|
||||
import { initialize } from 'src/cascade/js/MainPage/CascadeMain'
|
||||
import { useEffect, useState } from 'react'
|
||||
@@ -35,11 +35,10 @@ const HomePage = () => {
|
||||
}, [])
|
||||
return (
|
||||
|
||||
<BlogLayout>
|
||||
<MainLayout>
|
||||
<div>current code {code}</div>
|
||||
<BlogPostsCell/>
|
||||
<div>
|
||||
<h1 hidden></h1>
|
||||
<div id="topnav" className="topnav">
|
||||
<a href="https://github.com/zalo/CascadeStudio">Cascade Studio 0.0.6</a>
|
||||
<a href="#" id="main-proj-button" title="Sets this project to save in local storage." onClick={() => makeMainProject()}>Make Main Project</a>
|
||||
@@ -70,7 +69,7 @@ const HomePage = () => {
|
||||
</div>
|
||||
<footer>footer</footer>
|
||||
</div>
|
||||
</BlogLayout>
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
12
web/src/pages/NewPartPage/NewPartPage.js
Normal file
12
web/src/pages/NewPartPage/NewPartPage.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import PartsLayout from 'src/layouts/PartsLayout'
|
||||
import NewPart from 'src/components/NewPart'
|
||||
|
||||
const NewPartPage = () => {
|
||||
return (
|
||||
<PartsLayout>
|
||||
<NewPart />
|
||||
</PartsLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default NewPartPage
|
||||
15
web/src/pages/PartPage/PartPage.js
Normal file
15
web/src/pages/PartPage/PartPage.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import PartsLayout from 'src/layouts/PartsLayout'
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import PartCell from 'src/components/PartCell'
|
||||
|
||||
const PartPage = ({ id }) => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<PartsLayout>
|
||||
<PartCell id={id} />
|
||||
</PartsLayout>
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default PartPage
|
||||
15
web/src/pages/PartsPage/PartsPage.js
Normal file
15
web/src/pages/PartsPage/PartsPage.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import PartsLayout from 'src/layouts/PartsLayout'
|
||||
import PartsCell from 'src/components/PartsCell'
|
||||
|
||||
const PartsPage = () => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<PartsLayout>
|
||||
<PartsCell />
|
||||
</PartsLayout>
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export default PartsPage
|
||||
@@ -1,11 +1,14 @@
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import PostsLayout from 'src/layouts/PostsLayout'
|
||||
import PostsCell from 'src/components/PostsCell'
|
||||
|
||||
const PostsPage = () => {
|
||||
return (
|
||||
<PostsLayout>
|
||||
<PostsCell />
|
||||
</PostsLayout>
|
||||
<MainLayout>
|
||||
<PostsLayout>
|
||||
<PostsCell />
|
||||
</PostsLayout>
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user