Skip to content

Commit 8f1c11a

Browse files
authored
Merge branch '100xdevs-cohort-2:master' into master
2 parents 9e03122 + 081be9e commit 8f1c11a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+25647
-0
lines changed

week-5/level-1/BusinessCard.png

23.2 KB
Loading

week-5/level-1/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
You have to create a simple React App which has a reusable Card Component which has the following
2+
- Ability to pass in props to the Component
3+
- The Card must show a person's
4+
- Name
5+
- A short description
6+
- LinkedIn, Twitter and other Social Media Handle buttons
7+
- Interests Section
8+
- You can assume that this is kind of an e-business card and feel free to put in your creativity
9+
- Additional & Slightly advanced:
10+
- Create a page where you can add these kind of Cards by taking input from the user
11+
- Create a backend server where these cards get stored in a DB and can handle basic CRUD operations
12+
- Give the feature to perform CRUD operations from the frontend (Can be restricted to the admin only as well)
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
export function BusinessCard(props) {
2+
return (
3+
<div style={styles.card}>
4+
<h2 style={styles.name}>{props.name}</h2>
5+
<p style={styles.description}>{props.description}</p>
6+
<h3 style={styles.interestsHeader}>Interests</h3>
7+
<ul style={styles.interestsList}>
8+
{props.interests.map((interest) => (
9+
<li key={interest} style={styles.interestItem}>
10+
{interest}
11+
</li>
12+
))}
13+
</ul>
14+
<div style={styles.socialLinks}>
15+
<a href={props.linkedin} target="_blank" rel="noopener noreferrer" style={{...styles.link, marginLeft: '0px'}}>
16+
LinkedIn
17+
</a>
18+
<br />
19+
<a href={props.twitter} target="_blank" rel="noopener noreferrer" style={styles.link}>
20+
Twitter
21+
</a>
22+
{props.otherSocialMedia && (
23+
<a href={props.otherSocialMedia} target="_blank" rel="noopener noreferrer" style={styles.link}>
24+
{props.otherSocialMedia.label}
25+
</a>
26+
)}
27+
</div>
28+
</div>
29+
);
30+
}
31+
32+
// Styles
33+
const styles = {
34+
card: {
35+
border: '1px solid #ddd',
36+
borderRadius: '8px',
37+
padding: '20px',
38+
margin: '20px',
39+
maxWidth: '400px',
40+
boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1)',
41+
backgroundColor: '#f8f9fa'
42+
},
43+
name: {
44+
fontSize: '24px',
45+
marginBottom: '10px',
46+
color: '#333',
47+
},
48+
description: {
49+
fontSize: '16px',
50+
color: '#555',
51+
marginBottom: '15px',
52+
},
53+
socialLinks: {
54+
display: 'flex',
55+
marginBottom: '15px',
56+
},
57+
link: {
58+
textDecoration: 'none',
59+
color: '#fff', // Text color
60+
padding: '10px 15px', // Padding for the button
61+
borderRadius: '5px', // Border radius for rounded corners
62+
backgroundColor: '#007BFF', // Background color for the button
63+
display: 'inline-block', // Display as inline-block to be side by side
64+
margin: '10px', // Margin between buttons
65+
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)', // Box shadow for a subtle lift
66+
},
67+
interestsHeader: {
68+
fontSize: '18px',
69+
marginBottom: '10px',
70+
color: '#333',
71+
},
72+
interestsList: {
73+
listStyle: 'none',
74+
padding: 0,
75+
margin: 0,
76+
},
77+
interestItem: {
78+
fontSize: '14px',
79+
marginBottom: '5px',
80+
color: '#555',
81+
},
82+
};

week-6/1-use-memo/.eslintrc.cjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:react/recommended',
7+
'plugin:react/jsx-runtime',
8+
'plugin:react-hooks/recommended',
9+
],
10+
ignorePatterns: ['dist', '.eslintrc.cjs'],
11+
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12+
settings: { react: { version: '18.2' } },
13+
plugins: ['react-refresh'],
14+
rules: {
15+
'react-refresh/only-export-components': [
16+
'warn',
17+
{ allowConstantExport: true },
18+
],
19+
},
20+
}

week-6/1-use-memo/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

week-6/1-use-memo/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# React + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

week-6/1-use-memo/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.jsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)