Skip to content

MP-276 adding more modals -> dev #817

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

Merged
merged 1 commit into from
Jul 21, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@import "@libs/ui/styles/includes";

.container {
display: flex;
flex-direction: column;

.content {
.contentHeader {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid $black-10;
margin: $sp-4 0;
padding-bottom: $sp-2;

.contentHeaderActions {
button {
margin-right: $sp-2;

&:last-child {
margin-right: 0;
}
}
}
}

.contentBody {
height: 385px;
overflow: auto;

@include ltelg {
height: auto;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/* eslint-disable complexity */
import { Dispatch, FC, SetStateAction, useState } from 'react'

import { BaseModal } from '~/libs/ui'
import {
MemberStats,
} from '~/libs/core'

import { numberToFixed } from '../../lib'

import styles from './BannersIconsDetailsModal.module.scss'

type WebDesignViewTypes = 'CHALLENGES DETAILS'

interface BannersIconsDetailsModalProps {
onClose: () => void
bannersIconsStats: MemberStats | undefined
}

const BannersIconsDetailsModal: FC<BannersIconsDetailsModalProps> = (props: BannersIconsDetailsModalProps) => {
const [viewType]: [WebDesignViewTypes, Dispatch<SetStateAction<WebDesignViewTypes>>]
= useState<WebDesignViewTypes>('CHALLENGES DETAILS')

return (
<BaseModal
onClose={props.onClose}
open
size='body'
title='Banners Or Icons'
>

<div className={styles.container}>
<div className='member-stat-header'>
<div>
<span className='member-stat-value'>{props.bannersIconsStats?.wins}</span>
Wins
</div>
<div>
<span className='member-stat-value'>{props.bannersIconsStats?.challenges}</span>
Challenges
</div>
<div>
<span className='member-stat-value'>
{numberToFixed(props.bannersIconsStats?.rank?.overallPercentile || 0)}
%
</span>
Percentile
</div>
<div>
<span className='member-stat-value'>
{numberToFixed(props.bannersIconsStats?.screeningSuccessRate || 0)}
%
</span>
Screening Success Rate
</div>
<div>
<span className='member-stat-value'>
{numberToFixed(props.bannersIconsStats?.avgPlacement || 0)}
</span>
Average Placement
</div>
</div>

<div className={styles.content}>
<div className={styles.contentHeader}>
<h4>{viewType}</h4>
</div>

<div className={styles.contentBody}>
{
viewType === 'CHALLENGES DETAILS' && (
<div />
)

}
</div>
</div>
</div>
</BaseModal>
)
}

export default BannersIconsDetailsModal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as BannersIconsDetailsModal } from './BannersIconsDetailsModal'
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const DesignF2FDetailsModal: FC<DesignF2FDetailsModalProps> = (props: DesignF2FD
Screening Success Rate
</div>
<div>
<span className='member-stat-value'>{props.designF2FStats?.avgPlacement}</span>
<span className='member-stat-value'>
{numberToFixed(props.designF2FStats?.avgPlacement || 0)}
</span>
Average Placement
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@import "@libs/ui/styles/includes";

.container {
display: flex;
flex-direction: column;

.content {
.contentHeader {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid $black-10;
margin: $sp-4 0;
padding-bottom: $sp-2;

.contentHeaderActions {
button {
margin-right: $sp-2;

&:last-child {
margin-right: 0;
}
}
}
}

.contentBody {
height: 385px;
overflow: auto;

@include ltelg {
height: auto;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* eslint-disable complexity */
import { Dispatch, FC, SetStateAction, useState } from 'react'

import { BaseModal } from '~/libs/ui'
import {
MemberStats,
} from '~/libs/core'

import { numberToFixed } from '../../lib'

import styles from './FEDesignDetailsModal.module.scss'

type WebDesignViewTypes = 'CHALLENGES DETAILS'

interface FEDesignDetailsModalProps {
onClose: () => void
feDesignStats: MemberStats | undefined
}

const FEDesignDetailsModal: FC<FEDesignDetailsModalProps>
= (props: FEDesignDetailsModalProps) => {
const [viewType]: [WebDesignViewTypes, Dispatch<SetStateAction<WebDesignViewTypes>>]
= useState<WebDesignViewTypes>('CHALLENGES DETAILS')

return (
<BaseModal
onClose={props.onClose}
open
size='body'
title='Application Front End Design'
>

<div className={styles.container}>
<div className='member-stat-header'>
<div>
<span className='member-stat-value'>{props.feDesignStats?.wins}</span>
Wins
</div>
<div>
<span className='member-stat-value'>{props.feDesignStats?.challenges}</span>
Challenges
</div>
<div>
<span className='member-stat-value'>
{numberToFixed(props.feDesignStats?.rank?.overallPercentile || 0)}
%
</span>
Percentile
</div>
<div>
<span className='member-stat-value'>
{numberToFixed(props.feDesignStats?.screeningSuccessRate || 0)}
%
</span>
Screening Success Rate
</div>
<div>
<span className='member-stat-value'>
{numberToFixed(props.feDesignStats?.avgPlacement || 0)}
</span>
Average Placement
</div>
</div>

<div className={styles.content}>
<div className={styles.contentHeader}>
<h4>{viewType}</h4>
</div>

<div className={styles.contentBody}>
{
viewType === 'CHALLENGES DETAILS' && (
<div />
)

}
</div>
</div>
</div>
</BaseModal>
)
}

export default FEDesignDetailsModal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as FEDesignDetailsModal } from './FEDesignDetailsModal'
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@import "@libs/ui/styles/includes";

.container {
display: flex;
flex-direction: column;

.content {
.contentHeader {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid $black-10;
margin: $sp-4 0;
padding-bottom: $sp-2;

.contentHeaderActions {
button {
margin-right: $sp-2;

&:last-child {
margin-right: 0;
}
}
}
}

.contentBody {
height: 385px;
overflow: auto;

@include ltelg {
height: auto;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/* eslint-disable complexity */
import { Dispatch, FC, SetStateAction, useState } from 'react'

import { BaseModal } from '~/libs/ui'
import {
MemberStats,
} from '~/libs/core'

import { numberToFixed } from '../../lib'

import styles from './FrontEndFlashDetailsModal.module.scss'

type WebDesignViewTypes = 'CHALLENGES DETAILS'

interface FrontEndFlashDetailsModalProps {
onClose: () => void
froneEndFlashStats: MemberStats | undefined
}

const FrontEndFlashDetailsModal: FC<FrontEndFlashDetailsModalProps> = (props: FrontEndFlashDetailsModalProps) => {
const [viewType]: [WebDesignViewTypes, Dispatch<SetStateAction<WebDesignViewTypes>>]
= useState<WebDesignViewTypes>('CHALLENGES DETAILS')

return (
<BaseModal
onClose={props.onClose}
open
size='body'
title='Front End Flash'
>

<div className={styles.container}>
<div className='member-stat-header'>
<div>
<span className='member-stat-value'>{props.froneEndFlashStats?.wins}</span>
Wins
</div>
<div>
<span className='member-stat-value'>{props.froneEndFlashStats?.challenges}</span>
Challenges
</div>
<div>
<span className='member-stat-value'>
{numberToFixed(props.froneEndFlashStats?.rank?.overallPercentile || 0)}
%
</span>
Percentile
</div>
<div>
<span className='member-stat-value'>
{numberToFixed(props.froneEndFlashStats?.screeningSuccessRate || 0)}
%
</span>
Screening Success Rate
</div>
<div>
<span className='member-stat-value'>
{numberToFixed(props.froneEndFlashStats?.avgPlacement || 0)}
</span>
Average Placement
</div>
</div>

<div className={styles.content}>
<div className={styles.contentHeader}>
<h4>{viewType}</h4>
</div>

<div className={styles.contentBody}>
{
viewType === 'CHALLENGES DETAILS' && (
<div />
)

}
</div>
</div>
</div>
</BaseModal>
)
}

export default FrontEndFlashDetailsModal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as FrontEndFlashDetailsModal } from './FrontEndFlashDetailsModal'
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const LogoDesignDetailsModal: FC<LogoDesignDetailsModalProps> = (props: LogoDesi
Screening Success Rate
</div>
<div>
<span className='member-stat-value'>{props.logoDesignStats?.avgPlacement}</span>
<span className='member-stat-value'>
{numberToFixed(props.logoDesignStats?.avgPlacement || 0)}
</span>
Average Placement
</div>
</div>
Expand Down
Loading