Skip to content
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
1,343 changes: 1,024 additions & 319 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"bulma": "^1.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
Expand Down Expand Up @@ -34,5 +35,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"tailwindcss": "^3.4.15"
}
}
24 changes: 7 additions & 17 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
import logo from './logo.svg';
import "bulma/css/bulma.css";
import './App.css';
import Navbar from './components/Navbar';
import SignupForm from './components/SignupForm';

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<div className="bg-white">
<Navbar />
<SignupForm />
</div>
);
}

export default App;
export default App;
14 changes: 14 additions & 0 deletions src/components/CoolButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

function CoolButton({ isSuccess, children }) {

const className = isSuccess ? 'button is-success' : 'button';

return (
<button className={className}>
{children}
</button>
);
}

export default CoolButton;
18 changes: 18 additions & 0 deletions src/components/FormField.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';

function FormField({ label, type, placeholder }) {
return (
<div className="bg-white p-4 rounded shadow-md">
<label className="block text-black mb-2">{label}</label>
<div className="control">
<input
className="input bg-white border border-gray-300 rounded p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
type={type}
placeholder={placeholder}
/>
</div>
</div>
);
}

export default FormField;
21 changes: 21 additions & 0 deletions src/components/Navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import CoolButton from './CoolButton';

function Navbar() {
return (
<nav className="bg-white shadow">
<div className="flex justify-between items-center p-4">
<div className='flex items-center'>
<img alt="logo" src="https://bulma.io/assets/brand/Bulma%20Logo.png" className="h-10 mr-2" />
<button className="navbar-item">Home</button>
</div>
<div className='flex space-x-2'>
<CoolButton isSuccess>Login</CoolButton> {/* Use CoolButton for Login */}
<CoolButton>Signup</CoolButton> {/* Use CoolButton for Signup */}
</div>
</div>
</nav>
);
}

export default Navbar;
16 changes: 16 additions & 0 deletions src/components/SignupForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import FormField from './FormField';
import CoolButton from './CoolButton';

function SignupForm() {
return (
<form className="flex flex-col max-w-md mx-auto p-4 space-y-4">
<FormField label="Name" type="text" placeholder="e.g. Alex Smith" />
<FormField label="Email" type="email" placeholder="e.g. alexsmith@gmail.com" />
<FormField label="Password" type="password" placeholder="Enter your password" />
<CoolButton isSuccess>Submit</CoolButton>
</form>
);
}

export default SignupForm;
16 changes: 3 additions & 13 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
8 changes: 8 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
}