Skip to content

Commit b1b9cab

Browse files
committed
preapre to pull from Shana
1 parent b4ce4c9 commit b1b9cab

File tree

7 files changed

+25
-5
lines changed

7 files changed

+25
-5
lines changed
File renamed without changes.
File renamed without changes.

app/src/Dashboard/ProjectContainer.jsx renamed to app/src/Dashboard/ProjectContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
33

44
import { gql, useQuery } from '@apollo/client';
55

6-
import Project from './Project.jsx';
6+
import Project from './Project.tsx';
77
// Implement Apollo Client useQuery hook to retrieve data from the server through graphQL. This includes 2 steps:
88
// 1) Impliment Apollo Provider in the top component in ./src/index.js, this allows children components access to the queried data
99
// 2) useQuery hook will update the data stored in Apollo Client's cache and automatically trigger child components rendering

app/src/Dashboard/gqlStrings.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { gql } from '@apollo/client';
2+
3+
export const {
4+
ADD_LIKE: gql`mutation AddLike($projId: ID!, $likes: Int!) {
5+
addLike(projId: $projId, likes: $likes)
6+
{
7+
id
8+
likes
9+
}
10+
}`,
11+
12+
MAKE_COPY: gql`
13+
mutation MakeCopy ($userId: ID!, $projId: ID!, $username: String!) {
14+
makeCopy(userId: $userId, projId: $projId, username: $username)
15+
{
16+
id
17+
}
18+
}`;
19+
20+
}

app/src/components/top/NavBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export default function NavBar(props) {
168168
</Typography>
169169

170170
{/* ==================================Dashboard Button================================================== */}
171-
<Link to='/dashboard' style ={ {textDecoration: 'none'} }>
171+
{state.isLoggedIn ? <Link to='/dashboard' style ={ {textDecoration: 'none'} }>
172172
<Button
173173
variant="contained"
174174
color="primary"
@@ -178,7 +178,7 @@ export default function NavBar(props) {
178178
>
179179
Dashboard
180180
</Button>
181-
</Link>
181+
</Link> : <span></span>}
182182
{/* ==================================Dashboard Button================================================== */}
183183

184184
<Button

app/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import {
2020
/*
2121
* Dashboard
2222
*/
23-
// import TestDashboard from './Dashboard/FormsContainer.jsx';
24-
import ProjectDashboard from './Dashboard/ProjectContainer.jsx';
23+
// import TestDashboard from './Dashboard/FormsContainer.ts';
24+
import ProjectDashboard from './Dashboard/ProjectContainer.tsx';
2525

2626
import styles from './Dashboard/styles.css';
2727
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';

0 commit comments

Comments
 (0)