Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes during the mini-hackathon mob programming session. Might need… #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23,037 changes: 22,971 additions & 66 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"axios": "^0.19.2",
"emotion": "^10.0.23",
"globalize": "^1.4.2",
"moment": "^2.29.1",
"jshint": "^2.12.0",
"moment": "^2.29.1",
"query-string": "^6.12.1",
"react": "^16.8.3",
"react-dom": "^16.8.3",
Expand Down
21 changes: 16 additions & 5 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,21 @@ h2 {
}

.project-summary {
margin: 25px;
padding-left: 10px;
border: 2px;
border-style: groove;
max-width: 500px;
display: grid;
max-width: 1250px;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1rem;
margin-top: 2rem;
}

.project-page{
display:block;
}

.project-card {
border: 2px solid red;
padding: 5px;
align-items: start;
}

.project-summary:hover {
Expand All @@ -189,6 +199,7 @@ h2 {
border-color: #61dafb;
}


.centered-text {
text-align: center;
display: block;
Expand Down
4 changes: 1 addition & 3 deletions src/Components/Pages/Project/AddProjectButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ const AddProjectButton = ({text, action}) => {
return (
<div>
<Button
style={{float: 'left',
margin: '20px' }}
type="primary"
onClick={action}
disabled={!global.user}
>
{text}
</Button>
{!global.user && <a style={{float: 'left', margin: '20px' }} href={'/login'}>Login to create a project</a>}
{!global.user && <a href={'/login'}>Login to create a project</a>}
</div>
)

Expand Down
2 changes: 1 addition & 1 deletion src/Components/Pages/Project/ProjectList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ProjectList extends React.Component {
return <div>Loading...</div>;
} else {
return (
<div style={{marginBottom: '25px'}}>
<div className='project-summary' style={{marginBottom: '25px'}}>
{projects.map(project => <ProjectSummary style={style} props={project} key={project.id} /> )}
</div>
)
Expand Down
1 change: 1 addition & 0 deletions src/Components/Pages/ProjectPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class ProjectPage extends React.Component {
console.log(this.state);
const { project, comments } = this.state;
return (

<div style={{maxWidth: "1250px", margin: 'auto'}}>
<div>
<h1> {project.name} </h1>
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Pages/ProjectSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const ProjectSummary = (props) => {
let history = useHistory();

return (
<div onClick={() => projectClicked(history, project.id)} className={'project-summary'} style={props.style}>
<div onClick={() => projectClicked(history, project.id)} className='project-card' style={props.style}>
<h3 className={'centered-text'}><b>{project.name}</b></h3>
<p> {project.description} </p>
<p> {project.description.length > 250 ? project.description.substring(0,250) + '...' : project.description} </p>
<TechStack techStackAsString={stack}></TechStack>
<br/>
</div>
Expand Down
11 changes: 7 additions & 4 deletions src/Components/Pages/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Projects extends React.Component {

render() {
return (
<div className='project-page'>
<div>
<ProjectForm
onSubmit={this.handleAddProject}
Expand All @@ -59,14 +60,16 @@ class Projects extends React.Component {
<AddProjectButton
action={() => {this.setState({ showProjectForm: !this.state.showProjectForm })}}
text={ this.state.showProjectForm ? 'Cancel' : 'Add new project' }
/>
<br/>
<br/>
<ProjectList
/>
</div>
<div>
<ProjectList
onProjectLoaded={projects => this.setState({projects})}
projects={this.state.projects}
/>
</div>

</div>
);
}
}
Expand Down