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

Implemented Tailwind / Added Forms #48

Merged
merged 8 commits into from
Feb 29, 2024
Merged
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
163 changes: 149 additions & 14 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
},
"devDependencies": {
"@types/leaflet": "^1.9.8",
"cypress": "^13.6.4"
"autoprefixer": "^10.4.17",
"cypress": "^13.6.4",
"postcss-loader": "^8.1.0",
"tailwindcss": "^3.4.1"
}
}
7 changes: 7 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}

11 changes: 10 additions & 1 deletion src/apiTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface CountryData {
id: string;
type: string;
attributes: CountryAttributes;
}
}

export interface ApiResponse {
country: {
Expand All @@ -35,4 +35,13 @@ export interface ApiResponse {
breads: {
data: BreadData[];
};
}

export interface UserCredentials {
email: string;
password: string;
}

export interface NewUser extends UserCredentials {
name: string;
}
4 changes: 2 additions & 2 deletions src/components/App/App.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.App {
background-color: #d0c5b9;
max-height: 100vh;
min-height: 100vh;
display: flex;
flex-direction: column;
font-family: 'Satisfy', cursive;
font-family: "Satisfy", cursive;
justify-content: space-between;
}
5 changes: 5 additions & 0 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import Main from '../Main/Main';
import BreadList from '../BreadList/BreadList';
import BreadDetail from '../BreadDetail/BreadDetail';
import Error from "../Error/Error";
import CreateAcctForm from '../CreateAcctForm/CreateAcctForm';
import LoginForm from '../LoginForm/LoginForm';

import './App.css';
import 'leaflet/dist/leaflet.css';

Expand All @@ -17,6 +20,8 @@ function App() {
<Route path="/" element={<Main />} />
<Route path="/breads/:id" element={<BreadList />} />
<Route path="/breads/:id/:breadId" element={<BreadDetail />} />
<Route path="/create-account" element={<CreateAcctForm />} />
<Route path="/login" element={<LoginForm />} />
<Route path="*" element={<Error />} />
</Routes>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/BreadList/BreadList.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@
@media screen and (min-width: 1025px){
.BreadListWrapper h2 {
margin-top: 2rem;
font-size: xx-large;
font-size: 2rem;
margin-bottom: 1rem;
Copy link
Contributor

@dsstevens dsstevens Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be a merge conflict with the working code on my branch but since my styling has all migrated to the inline JSX with Tailwind, it should be easy to reconcile. If we need to change the font and margin top, we can adjust as needed.

margin-top: 3rem;
}

.BreadListWrapper p {
Expand Down
69 changes: 69 additions & 0 deletions src/components/CreateAcctForm/CreateAcctForm.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.acct-form-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 0.9375rem;
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
padding: 2rem;
margin: 3rem auto;
width: calc(100% - 4rem);
max-width: 31.25rem;
font-family: "Abel", sans-serif;
gap: 1.25rem;
}

form {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}


.acct-form-container h2 {
text-align: center;
color: #333;
font-family: "Satisfy", cursive;
font-size: 2rem;

}

.acct-form-container input {
border: .125rem solid #82aa9f;
border-radius: 0.3125rem;
padding: 0.625rem;
font-size: 1rem;
color: #333;
width: 100%;
margin-bottom: 1rem;
}

.acct-form-container input::placeholder {
color: #666;
}

.acct-form-container button {
background: #82aa9f;
color: white;
padding: 0.625rem 1.25rem;
border: none;
border-radius: 3125rem;
cursor: pointer;
transition: background-color 0.5s ease;
width: 100%;
margin-bottom: 1rem;
}

.acct-form-container button:hover {
background-color: #f0a200;
}

/* Adjustments for larger screens */
@media screen and (min-width: 750px) {
.acct-form-container {
width: 80%;
max-width: 31.25rem;
}
}
Loading
Loading