Skip to content

Commit

Permalink
Stateless Functional Components
Browse files Browse the repository at this point in the history
  • Loading branch information
15Dkatz committed Oct 19, 2022
1 parent dd44412 commit bd64536
Show file tree
Hide file tree
Showing 11 changed files with 492 additions and 510 deletions.
Binary file modified portfolio/.parcel-cache/data.mdb
Binary file not shown.
2 changes: 1 addition & 1 deletion portfolio/dist/index.61d3354a.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

862 changes: 429 additions & 433 deletions portfolio/dist/index.975ef6c8.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion portfolio/dist/index.975ef6c8.js.map

Large diffs are not rendered by default.

38 changes: 0 additions & 38 deletions portfolio/src/Projects.js

This file was deleted.

35 changes: 0 additions & 35 deletions portfolio/src/SocialProfiles.js

This file was deleted.

2 changes: 1 addition & 1 deletion portfolio/src/App.js → portfolio/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from 'react';
import Projects from './Projects';
import SocialProfiles from './SocialProfiles';
import Title from './Title';
import profile from './assets/profile.png';
import profile from '../assets/profile.png';

class App extends Component {
state = { displayBio: false };
Expand Down
30 changes: 30 additions & 0 deletions portfolio/src/components/Projects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react';
import PROJECTS from '../data/projects';

const Project = props => {
const { title, image, description, link } = props.project;

return (
<div style={{ display: 'inline-block', width: 300, margin: 10 }}>
<h3>{title}</h3>
<img src={image} alt='profile' style={{ width: 200, height: 120 }} />
<p>{description}</p>
<a href={link}>{link}</a>
</div>
);
}

const Projects = () => (
<div>
<h2>Highlighted Projects</h2>
<div>
{
PROJECTS.map(PROJECT => (
<Project key={PROJECT.id} project={PROJECT} />
))
}
</div>
</div>
);

export default Projects;
29 changes: 29 additions & 0 deletions portfolio/src/components/SocialProfiles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import SOCIAL_PROFILES from '../data/socialProfiles';

const SocialProfile = props => {
const { link, image } = props.socialProfile;

return (
<span>
<a href={link}>
<img src={image} alt='social-profile' style={{ width: 35, height: 35, margin: 10 }} />
</a>
</span>
)
}

const SocialProfiles = () => (
<div>
<h2>Connect with me!</h2>
<div>
{
SOCIAL_PROFILES.map(SOCIAL_PROFILE => {
return <SocialProfile key={SOCIAL_PROFILE.id} socialProfile={SOCIAL_PROFILE} />;
})
}
</div>
</div>
);

export default SocialProfiles;
File renamed without changes.
2 changes: 1 addition & 1 deletion portfolio/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import App from './components/App';
import './index.css';

const root = ReactDOM.createRoot(document.getElementById('root'));
Expand Down

0 comments on commit bd64536

Please sign in to comment.