Skip to content

Commit 32f02ee

Browse files
authored
Merge pull request #17 from oslabs-beta/denton/link
Denton/link
2 parents 0507bbd + c425a8e commit 32f02ee

File tree

17 files changed

+116
-49
lines changed

17 files changed

+116
-49
lines changed

app/src/Dashboard/NavbarDash.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,13 @@ export default function NavBar(props) {
9393
<div className={classes.root} style={style}>
9494
<AppBar position='static'>
9595
<Toolbar>
96-
<Avatar src={greenLogo}></Avatar>
97-
<Typography variant="h6" style={{ marginLeft: '1rem' }} className={classes.title}>
98-
ReacType
99-
</Typography>
100-
<div style ={ { textDecoration: 'none' } }>
96+
<Link to="/" style={{display: 'inline-flex', justifyContent: 'center', textDecoration: 'none'}}>
97+
<Avatar src={greenLogo}></Avatar>
98+
<Typography variant="h6" style={{ marginTop: '0.3rem', marginLeft: '0.5rem', color: 'silver' }} className={classes.title}>
99+
ReacType
100+
</Typography>
101+
</Link>
102+
<div style ={ { marginLeft: '0.5rem', textDecoration: 'none' } }>
101103
<Button
102104
variant='contained'
103105
color='primary'

app/src/components/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ export const App = (): JSX.Element => {
9393

9494
return (
9595
<div className="app">
96-
<DndProvider backend={HTML5Backend}>
96+
9797
<header
9898
style={{ height: '40px', width: '100%', backgroundColor: 'white' }}
9999
>
100100
ReacType
101101
</header>
102102

103103
<AppContainer />
104-
</DndProvider>
104+
105105
</div>
106106
);
107107
};

app/src/components/bottom/BottomPanel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ const BottomPanel = (props): JSX.Element => {
3636
}, []);
3737

3838
return (
39+
<>
3940
<div className="bottom-panel" id="resize" ref={node}>
4041
<div id="resize-drag" onMouseDown={mouseDownHandler} tabIndex={0}>
4142
......
4243
</div>
4344
<BottomTabs isThemeLight={props.isThemeLight} />
44-
</div>
45+
</div></>
4546
);
4647
};
4748

app/src/components/bottom/BottomTabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const BottomTabs = (props): JSX.Element => {
4949
return (
5050
<div
5151
className={`${classes.root} ${classes.rootLight}`}
52-
style={{ backgroundColor: '#191919' }}
52+
style={{ backgroundColor: '#191919' , zIndex: 1, borderTop: '2px solid grey'}}
5353
>
5454
<Box
5555
display="flex"

app/src/components/left/Sidebar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface SidebarProps {
1212
}
1313

1414
const Sidebar: React.FC<SidebarProps> = ({ value, setValue }) => {
15+
console.log('sidebar value', value);
1516
return (
1617
<Tabs
1718
orientation="vertical"

app/src/components/main/CanvasContainer.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,38 @@ function CanvasContainer(props): JSX.Element {
2525
const canvasContainerStyle = {
2626
width: '100%',
2727
backgroundColor: 'lightgrey',
28-
border: '2px Solid grey',
29-
overflow: 'auto',
28+
border: '2px solid grey',
29+
borderBottom: 'none',
30+
overflow: 'auto',
3031
};
3132

3233
const codePreviewStyle = {
33-
position: 'absolute',
34+
position: 'fixed',
3435
width: 'max-content',
3536
height: 'max-content',
3637
bottom: '100px',
3738
right: '51vw',
3839
textAlign: 'center',
3940
color: '#ffffff',
40-
backgroundColor: '#151515'
41+
backgroundColor: '#151515',
42+
zIndex: 0
43+
44+
45+
4146
} as const;
4247

4348
return (
4449
<div style={canvasContainerStyle}>
4550
{state.codePreview && <CodePreview theme={theme} setTheme={setTheme}/>}
4651
{!state.codePreview && <Canvas isThemeLight={props.isThemeLight}/>}
52+
4753
<Button
4854
style={codePreviewStyle}
4955
onClick={onClickCodePreview}
5056
>
5157
Code Preview
5258
</Button>
59+
5360
</div>
5461
);
5562
}

app/src/components/main/DemoRender.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const DemoRender = (): JSX.Element => {
2323
width: '100%',
2424
backgroundColor: '#FBFBFB',
2525
border: '2px Solid grey',
26+
borderBottom: 'none',
2627
overflow: 'auto'
2728
};
2829

app/src/components/marketplace/MarketplaceCard.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,20 @@ import React from 'react';
1818
import imageSrc from '../../../../resources/marketplace_images/marketplace_image.png';
1919
import { red } from '@mui/material/colors';
2020

21+
interface Project {
22+
comments: string[]
23+
createdAt: Date
24+
likes: number
25+
name: string
26+
project: object
27+
published: boolean
28+
userId: number
29+
username: string
30+
_id: number
31+
}
32+
2133
const ITEM_HEIGHT = 48;
22-
const MarketplaceCard = () => {
34+
const MarketplaceCard = ({proj} :{proj: Project}) => {
2335
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
2436
const open = Boolean(anchorEl);
2537
const handleClick = (event: React.MouseEvent<HTMLElement>) => {
@@ -58,8 +70,8 @@ const MarketplaceCard = () => {
5870
<MoreVert />
5971
</IconButton>
6072
}
61-
title="Gradient Buttons"
62-
subheader="Liam Rohn"
73+
title={proj.name}
74+
subheader={proj.username}
6375
/>
6476
<Menu
6577
id="long-menu"

app/src/components/marketplace/MarketplaceCardContainer.tsx

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
import { Container, Grid } from '@mui/material';
22

33
import MarketplaceCard from './MarketplaceCard';
4-
import React from 'react';
4+
import React, {useEffect, useState} from 'react';
5+
import axios from 'axios';
56

67
const MarketplaceCardContainer = () => {
7-
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9];
8+
9+
const [marketplaceProjects, setMarketplaceProjects] = useState([]);
10+
useEffect(() => {
11+
async function marketplaceFetch() {
12+
try {
13+
const response = await axios.get('/getMarketplaceProjects', {
14+
headers: {
15+
'Content-Type': 'application/json',
16+
},
17+
withCredentials: true,
18+
});
19+
20+
setMarketplaceProjects(response.data);
21+
22+
} catch (error) {
23+
console.error('Error fetching MP data:', error);
24+
}
25+
}
26+
marketplaceFetch();
27+
28+
}, []);
29+
830
return (
931
<>
1032
<Container>
@@ -14,9 +36,10 @@ const MarketplaceCardContainer = () => {
1436
spacing={{ xs: 2, md: 3 }}
1537
columns={{ xs: 4, sm: 8, md: 12 }}
1638
>
17-
{numbers.map((num) => (
18-
<Grid item xs={4} sm={4} md={4} key={num}>
19-
<MarketplaceCard />
39+
{marketplaceProjects.map((proj, i) => (
40+
41+
<Grid item xs={4} sm={4} md={4} key={i}>
42+
<MarketplaceCard proj={proj}/>
2043
</Grid>
2144
))}
2245
</Grid>

app/src/components/top/NavBar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
2+
import { Link } from 'react-router-dom';
33
import Avatar from '@mui/material/Avatar';
44
import Button from '@mui/material/Button';
55
import MoreVertIcon from '@mui/icons-material/MoreVert';
@@ -58,12 +58,14 @@ const NavBar = () => {
5858
: { backgroundColor: '#151515' }
5959
}
6060
>
61+
<Link to="/" style={{ textDecoration: 'none' }}>
6162
<div className="main-logo">
6263
<Avatar src={logo}></Avatar>
6364
<h1 style={isDarkMode ? { color: 'white' } : { color: 'white' }}>
6465
ReacType
6566
</h1>
6667
</div>
68+
</Link>
6769
<div style={buttonContainerStyle}>
6870
<button style={buttonStyle}>Share</button>
6971
<NewExportButton />

0 commit comments

Comments
 (0)