-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework search page: show all service offerings [#88]
- Re enable ServiceOffering component - Simplify loading of the data in useEffect - Use semantically correct components - Introduce new generic components to structure better the component (Main, LoadingIndicator, CardContainer) - Refactor css styling in order to match the new data structure - Reorganize translations Signed-off-by: Zoltan M. <[email protected]> Signed-off-by: Zoltan Magyari <[email protected]>
- Loading branch information
Magyari Zoltan
authored and
Zoltan Magyari
committed
Aug 22, 2024
1 parent
1e251d1
commit 0cdc562
Showing
15 changed files
with
166 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { FC, ReactNode } from 'react'; | ||
|
||
interface IResultContainer { | ||
children: ReactNode; | ||
isLoaded: boolean; | ||
} | ||
|
||
const CardContainer: FC<IResultContainer> = ({ children, isLoaded }) => { | ||
return ( | ||
<div className={'card-container'}> | ||
{isLoaded && children} | ||
</div> | ||
) | ||
} | ||
|
||
export default CardContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.newCarLoader { | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
.car { | ||
width: 100px; | ||
height: 100px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { FC } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import car from '../../assets/car.gif'; | ||
|
||
import styles from './LoadingIndicator.css'; | ||
|
||
interface ILoadingIndicator { | ||
isLoading: boolean | ||
} | ||
|
||
const LoadingIndicator: FC<ILoadingIndicator> = ({ isLoading }) => { | ||
const { t } = useTranslation() | ||
|
||
if (isLoading) { | ||
return ( | ||
<div className={styles.newCarLoader}> | ||
<img src={car} alt={t('common.is-loading')} className={'car'}/> | ||
</div> | ||
) | ||
} | ||
return <></> | ||
} | ||
|
||
export default LoadingIndicator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.content { | ||
margin-top: 20px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { FC, ReactNode, useContext } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { AuthContext } from '../../context/AuthContextProvider'; | ||
|
||
import styles from './Main.css' | ||
|
||
interface IMain { | ||
children: ReactNode | ||
} | ||
|
||
const Main: FC<IMain> = ({ children }) => { | ||
const authContext = useContext(AuthContext); | ||
const { t } = useTranslation(); | ||
|
||
if (authContext.isAuthenticated) { | ||
return ( | ||
<main className={styles.content}> | ||
{children} | ||
</main> | ||
) | ||
} | ||
return <p>{t('common.not-authenticated')}</p> | ||
} | ||
|
||
export default Main; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.