Skip to content

Commit c9f02c7

Browse files
committed
add ProfileAPI Project
1 parent cc18eab commit c9f02c7

14 files changed

+5650
-0
lines changed

ProfileAPI/.eslintrc.cjs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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/jsx-no-target-blank': 'off',
16+
'react-refresh/only-export-components': [
17+
'warn',
18+
{ allowConstantExport: true },
19+
],
20+
},
21+
}

ProfileAPI/.gitignore

+24
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?

ProfileAPI/README.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Random User Card Component(API)
2+
3+
This React component (`Card.js`) fetches random user data from the [Random User API](https://randomuser.me/) and displays it in a card format.
4+
5+
## Features
6+
7+
- Fetches random user data using the Random User API.
8+
- Displays user's name, email, city, and country.
9+
- Allows user to fetch a new random user on button click.
10+
11+
### DEMO
12+
- Demo : [Simple Profile Card](https://profileinfothroughapi.netlify.app/)
13+
## Installation
14+
15+
1. Clone the repository:
16+
17+
```bash
18+
git clone https://github.com/your-username/your-repository.git
19+
```
20+
21+
2. Install dependencies:
22+
23+
```bash
24+
npm install
25+
```
26+
27+
## Usage
28+
29+
1. Import the `Card` component:
30+
31+
```jsx
32+
import Card from './Card';
33+
```
34+
35+
2. Include the `Card` component in your JSX:
36+
37+
```jsx
38+
<Card />
39+
```
40+
41+
## Example
42+
43+
```jsx
44+
import React from 'react';
45+
import Card from './Card';
46+
47+
const App = () => {
48+
return (
49+
<div>
50+
<h1>Random User Card</h1>
51+
<Card />
52+
</div>
53+
);
54+
};
55+
56+
export default App;
57+
```

ProfileAPI/index.html

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
8+
<title>Card Component Api</title>
9+
</head>
10+
<body>
11+
<style>
12+
*{
13+
margin: 0;
14+
padding: 0;
15+
box-sizing: border-box;
16+
font-family: "Poppins" , sans-serif;
17+
}
18+
:root{
19+
--theme-color : #5074f3;
20+
}
21+
body{
22+
background-color: var(--theme-color);
23+
}
24+
.card {
25+
box-shadow: 0 0 0 0.3em #5074f3 , 0 0 0.9em var(--theme-color) ;
26+
}
27+
</style>
28+
<div id="root"></div>
29+
<script type="module" src="/src/main.jsx"></script>
30+
</body>
31+
</html>

0 commit comments

Comments
 (0)