Skip to content

Commit

Permalink
delete Topic component and route; change name of Resources component …
Browse files Browse the repository at this point in the history
…to NewResource b00tc4mp#482
  • Loading branch information
juditta99 committed Apr 28, 2024
1 parent 366820e commit 62567e7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
6 changes: 2 additions & 4 deletions staff/judy-grayland/project/app/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import logic from './logic'
// pages
import Profile from './pages/Profile'
import Home from './pages/Home'
import Resources from './pages/Resources'
import NewResource from './pages/NewResource'
import Login from './pages/Login'
import Topic from './pages/Topic'
import Register from './pages/Register'
import { useNavigate } from 'react-router-dom'

Expand Down Expand Up @@ -48,9 +47,8 @@ function App() {
<Route element={<ProtectedRoute />}>
<Route path="profile" element={<Profile />} />
</Route>
<Route path="topic" element={<Topic />} />
<Route element={<ProtectedRoute />}>
<Route path="resources/new" element={<Resources />} />
<Route path="resources/new" element={<NewResource />} />
</Route>
</Routes>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function createResource({
validate.tagArray(topic, 'topic array')

if (resourceType === 'activity') {
validate.text(link, 'link')
validate.text(image, 'image')
validate.text(link, 'link')
}
if (resourceType === 'book') {
validate.text(author, 'author')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Form, Field, Button } from '../components'
import { useState } from 'react'
import logic from '../logic'

function Resources() {
function NewResource() {
const [resourceType, setResourceType] = useState('activity')

function handleCreateResourceSuccess() {
Expand Down Expand Up @@ -299,4 +299,4 @@ function Resources() {
)
}

export default Resources
export default NewResource
7 changes: 0 additions & 7 deletions staff/judy-grayland/project/app/src/pages/Topic.jsx

This file was deleted.

0 comments on commit 62567e7

Please sign in to comment.