Skip to content

Commit

Permalink
refactoring css
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapshtyk committed May 21, 2023
1 parent 3e5f94d commit 7b9ac04
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 28 deletions.
3 changes: 2 additions & 1 deletion src/components/AddRecipe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { CurrentUserContext, RecipesContext } from '../utils/context'
import { getCountries } from '../utils/CountryCode'

import cl from '../styles/AddRecipe.module.css'
import style from '../styles/Form.module.css'

const AddRecipe = () => {
const fetchRecipes = useContext(RecipesContext).fetchRecipes
Expand Down Expand Up @@ -123,7 +124,7 @@ const AddRecipe = () => {
}

return (
<div className={cl.form_container}>
<div className={style.container}>
<h2 className={cl.form_title}>Add recipe</h2>
<form
className={cl.form}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Authorization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CurrentUserContext, UsersContext } from '../utils/context'
import md5 from 'md5'

import cl from '../styles/Authorization.module.css'
import style from '../styles/AddRecipe.module.css'
import style from '../styles/Form.module.css'

const Authorization = ({ hasAccount }: AuthorizationType) => {
const [userData, setUserData] = useState<AuthorizationUserDataType>({
Expand Down Expand Up @@ -83,7 +83,7 @@ const Authorization = ({ hasAccount }: AuthorizationType) => {
}

return (
<div className={style.form_container} style={{ width: 400 }}>
<div className={style.container} style={{ width: 400 }}>
<h2 className={cl.authorization_title}>
{hasAccount ? 'Login' : 'Sign up'}
</h2>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Recipe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import AddComment from '../components/AddComment'

import cl from '../styles/Recipe.module.css'
import style from '../styles/Form.module.css'

const Recipe = () => {
const [recipe, setRecipe] = useState<RecipeType | undefined>()
Expand Down Expand Up @@ -89,7 +90,7 @@ const Recipe = () => {

if (recipe && 'id' in recipe) {
return (
<div className={cl.recipe_container}>
<div className={style.container}>
<h1 className={cl.recipe_title}>
{recipe.title} from {recipe.origin}
</h1>
Expand Down
12 changes: 0 additions & 12 deletions src/styles/AddRecipe.module.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
.form_container {
max-width: 700px;
margin: auto;
margin-top: 2rem;
margin-bottom: 1rem;
padding: 1.5rem;
border: 1px solid #e5e5e5;
border-radius: 1rem;
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.1), 0 3px 1px -2px rgba(0, 0, 0, 0.05),
0 2px 1px rgba(0, 0, 0, 0.02);
}

.form {
display: flex;
flex-direction: column;
Expand Down
11 changes: 11 additions & 0 deletions src/styles/Form.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.container {
max-width: 700px;
margin: auto;
margin-top: 2rem;
margin-bottom: 1rem;
padding: 1.5rem;
border: 1px solid #e5e5e5;
border-radius: 1rem;
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.1), 0 3px 1px -2px rgba(0, 0, 0, 0.05),
0 2px 1px rgba(0, 0, 0, 0.02);
}
12 changes: 0 additions & 12 deletions src/styles/Recipe.module.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
.recipe_container {
max-width: 700px;
margin: auto;
margin-top: 2rem;
margin-bottom: 1rem;
padding: 1.5rem;
border: 1px solid #e5e5e5;
border-radius: 1rem;
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.1), 0 3px 1px -2px rgba(0, 0, 0, 0.05),
0 2px 1px rgba(0, 0, 0, 0.02);
}

.recipe_title {
font-size: 2rem;
font-weight: bold;
Expand Down

0 comments on commit 7b9ac04

Please sign in to comment.