-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…dal-box Feature/#98 implement about modal box
- Loading branch information
Showing
36 changed files
with
495 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,15 @@ | ||
export const LinkedinIcon = () => { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1.03em" | ||
height="1em" | ||
viewBox="0 0 1536 1504" | ||
> | ||
<path | ||
fill="currentColor" | ||
d="M349 497v991H19V497zm21-306q1 73-50.5 122T184 362h-2q-82 0-132-49T0 191q0-74 51.5-122.5T186 20t133 48.5T370 191m1166 729v568h-329V958q0-105-40.5-164.5T1040 734q-63 0-105.5 34.5T871 854q-11 30-11 81v553H531q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52t87-43.5T1157 474q171 0 275 113.5T1536 920" | ||
/> | ||
</svg> | ||
); | ||
}; |
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,15 @@ | ||
interface Props { | ||
styleClass: string; | ||
} | ||
|
||
export const QuickmockLogoComponent = (props: Props) => { | ||
const { styleClass } = props; | ||
|
||
return ( | ||
<img | ||
className={styleClass} | ||
src={'public/widgets/bombilla.webp'} | ||
alt="Quickmock Logo" | ||
/> | ||
); | ||
}; |
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,15 @@ | ||
export const XIconComponent = () => { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
viewBox="0 0 256 256" | ||
> | ||
<path | ||
fill="currentColor" | ||
d="M204.24 195.76a6 6 0 1 1-8.48 8.48L128 136.49l-67.76 67.75a6 6 0 0 1-8.48-8.48L119.51 128L51.76 60.24a6 6 0 0 1 8.48-8.48L128 119.51l67.76-67.75a6 6 0 0 1 8.48 8.48L136.49 128Z" | ||
/> | ||
</svg> | ||
); | ||
}; |
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 @@ | ||
export * from './modal-dialog.component'; |
43 changes: 43 additions & 0 deletions
43
src/common/components/modal-dialog/modal-dialog.component.module.css
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,43 @@ | ||
.container { | ||
z-index: 2; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100vw; | ||
height: 100vh; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: column; | ||
background-color: var(--primary-900-50-opacity); | ||
} | ||
|
||
.dialogHeader { | ||
background-color: var(--primary-500); | ||
width: 70vw; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: var(--space-s) var(--space-md); | ||
border-top-left-radius: var(--border-radius-m); | ||
border-top-right-radius: var(--border-radius-m); | ||
} | ||
|
||
.dialogTitle { | ||
font-size: var(--fs-md); | ||
color: var(--pure-white); | ||
} | ||
|
||
.dialogButton { | ||
width: fit-content; | ||
margin-left: auto; | ||
background-color: transparent; | ||
color: var(--pure-white); | ||
padding: var(--space-xs); | ||
line-height: 0; | ||
border: none; | ||
} | ||
|
||
.dialogButton:hover { | ||
cursor: pointer; | ||
} |
33 changes: 33 additions & 0 deletions
33
src/common/components/modal-dialog/modal-dialog.component.tsx
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,33 @@ | ||
import { useModalDialogContext } from '@/core/providers/model-dialog-providers/model-dialog.provider'; | ||
import classes from './modal-dialog.component.module.css'; | ||
import React, { useEffect } from 'react'; | ||
import { XIconComponent } from '../icons'; | ||
|
||
export const ModalDialogComponent: React.FC = () => { | ||
const { modalDialog, closeModal } = useModalDialogContext(); | ||
const { isOpen, title, selectedComponent } = modalDialog; | ||
|
||
useEffect(() => {}, [modalDialog]); | ||
|
||
const handleClick = () => { | ||
closeModal(); | ||
}; | ||
|
||
return ( | ||
isOpen && ( | ||
<div className={classes.container}> | ||
<div className={classes.dialogHeader}> | ||
<h2 className={classes.dialogTitle}>{title}</h2> | ||
<button | ||
className={classes.dialogButton} | ||
onClick={handleClick} | ||
aria-label="close modal dialog" | ||
> | ||
<XIconComponent /> | ||
</button> | ||
</div> | ||
<div>{selectedComponent}</div> | ||
</div> | ||
) | ||
); | ||
}; |
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 @@ | ||
export * from './model-dialog.model'; |
6 changes: 6 additions & 0 deletions
6
src/core/providers/model-dialog-providers/model-dialog.context.ts
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,6 @@ | ||
import React from 'react'; | ||
|
||
import { ModalDialogContextModel } from './model-dialog.model'; | ||
|
||
export const ModalDialogContext = | ||
React.createContext<ModalDialogContextModel | null>(null); |
19 changes: 19 additions & 0 deletions
19
src/core/providers/model-dialog-providers/model-dialog.model.ts
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,19 @@ | ||
/* import React from 'react'; */ | ||
|
||
export interface ModalDialogModel { | ||
isOpen: boolean; | ||
selectedComponent: React.ReactNode | null; | ||
title: string; | ||
} | ||
|
||
export const createInitialModalDialog = (): ModalDialogModel => ({ | ||
isOpen: false, | ||
selectedComponent: null, | ||
title: '', | ||
}); | ||
|
||
export interface ModalDialogContextModel { | ||
openModal: (component: React.ReactNode | null, title: string) => void; | ||
closeModal: () => void; | ||
modalDialog: ModalDialogModel; | ||
} |
48 changes: 48 additions & 0 deletions
48
src/core/providers/model-dialog-providers/model-dialog.provider.tsx
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,48 @@ | ||
import React from 'react'; | ||
import { ModalDialogContext } from './model-dialog.context'; | ||
import { | ||
ModalDialogModel, | ||
createInitialModalDialog, | ||
} from './model-dialog.model'; | ||
|
||
interface Props { | ||
children: React.ReactNode; | ||
} | ||
|
||
export const ModalDialogProvider: React.FC<Props> = props => { | ||
const { children } = props; | ||
const [modalDialog, setModalDialog] = React.useState<ModalDialogModel>( | ||
createInitialModalDialog() | ||
); | ||
|
||
const openModal = (component: React.ReactNode | null, title: string) => { | ||
setModalDialog({ | ||
isOpen: true, | ||
selectedComponent: component, | ||
title, | ||
}); | ||
}; | ||
|
||
const closeModal = () => { | ||
setModalDialog({ | ||
isOpen: false, | ||
selectedComponent: null, | ||
title: '', | ||
}); | ||
}; | ||
|
||
return ( | ||
<ModalDialogContext.Provider value={{ openModal, closeModal, modalDialog }}> | ||
{children} | ||
</ModalDialogContext.Provider> | ||
); | ||
}; | ||
|
||
export const useModalDialogContext = () => { | ||
const context = React.useContext(ModalDialogContext); | ||
if (context === null) { | ||
throw 'useModalDialogContext: looks like you have forgotten to add the provider on top of the app :)'; | ||
} | ||
|
||
return context; | ||
}; |
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,41 @@ | ||
.container { | ||
background-color: var(--primary-700); | ||
width: 70vw; | ||
height: auto; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: var(--space-lg); | ||
border-bottom-left-radius: var(--border-radius-l); | ||
border-bottom-right-radius: var(--border-radius-l); | ||
gap: var(--space-s); | ||
} | ||
|
||
.projectLogo { | ||
display: block; | ||
width: 60px; | ||
height: 100%; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
.projectName { | ||
font-size: var(--fs-xxl); | ||
margin: 0; | ||
color: var(--pure-white); | ||
font-weight: var(--fw-extrabold); | ||
line-height: 1.3; | ||
} | ||
|
||
.projectVersion { | ||
margin: 0; | ||
font-size: var(--fs-lg); | ||
font-weight: var(--fw-medium); | ||
color: var(--pure-white); | ||
} | ||
|
||
.projectCommunity { | ||
margin: 0; | ||
margin-bottom: var(--space-lg); | ||
color: var(--primary-200); | ||
} |
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,17 @@ | ||
/* import { MemberListComponent } from './components/members.component'; | ||
import { memberList } from './members'; */ | ||
import { QuickmockLogoComponent } from '@/common/components/icons'; | ||
import classes from './about.pod.module.css'; | ||
import { DevelopmentTeamComponent } from './components/developmentTeam.component'; | ||
|
||
export const AboutPod = () => { | ||
return ( | ||
<div className={classes.container}> | ||
<QuickmockLogoComponent styleClass={classes.projectLogo} /> | ||
<h2 className={classes.projectName}>QuickMock</h2> | ||
<p className={classes.projectVersion}>Version 0.0</p> | ||
<p className={classes.projectCommunity}>Community preview</p> | ||
<DevelopmentTeamComponent /> | ||
</div> | ||
); | ||
}; |
16 changes: 16 additions & 0 deletions
16
src/pods/about/components/developmentTeam.component.module.css
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 @@ | ||
.team { | ||
font-size: var(--fs-lg); | ||
font-weight: var(--fw-medium); | ||
color: var(--pure-white); | ||
text-align: left; | ||
margin: 0; | ||
margin-bottom: var(--space-lg); | ||
align-self: flex-start; | ||
color: var(--primary-300); | ||
} | ||
|
||
.teamWrapper { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: var(--space-md) var(--space-xxl); | ||
} |
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 { memberList } from '../members'; | ||
import classes from './developmentTeam.component.module.css'; | ||
import { MemberListComponent } from './members.component'; | ||
|
||
export const DevelopmentTeamComponent = () => { | ||
return ( | ||
<> | ||
<h2 className={classes.team}>Development Team</h2> | ||
<div className={classes.teamWrapper}> | ||
{memberList.map(member => ( | ||
<MemberListComponent member={member} key={member.id} /> | ||
))} | ||
</div> | ||
</> | ||
); | ||
}; |
Oops, something went wrong.