-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(company certificate): list company certificates (#437)
- Loading branch information
1 parent
daffdc7
commit 1786e89
Showing
11 changed files
with
550 additions
and
4 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
151 changes: 151 additions & 0 deletions
151
src/components/pages/CompanyCertificates/CompanyCertificate.scss
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,151 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
|
||
.company-certificate-main { | ||
.company-certificate-section { | ||
margin-top: 72px; | ||
} | ||
|
||
.container { | ||
max-width: 1140px; | ||
margin: 0 auto; | ||
padding: 0 15px; | ||
|
||
.heading { | ||
text-align: center; | ||
} | ||
|
||
.description { | ||
text-align: center; | ||
margin: 34px auto 64px; | ||
width: 70%; | ||
} | ||
|
||
.mainContainer { | ||
width: 100%; | ||
max-width: 1100px; | ||
padding: 0 15px 0 15px !important; | ||
margin-right: auto; | ||
margin-left: auto; | ||
} | ||
|
||
.filterSection { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
margin-top: 30px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.filterSection .chipContainer { | ||
padding-left: 20px; | ||
} | ||
|
||
.sortSection { | ||
position: absolute; | ||
background: #f9f9f9; | ||
box-shadow: 0px 10px 20px rgb(80 80 80 / 30%); | ||
border-radius: 16px; | ||
z-index: 9; | ||
} | ||
|
||
.uploadBtn { | ||
width: 20%; | ||
margin: 0 auto; | ||
margin-bottom: 80px; | ||
} | ||
|
||
.company-certificate-section { | ||
margin: 0 -15px !important; | ||
width: calc(100% + 30px) !important; | ||
|
||
.company-certificate-card { | ||
padding: 0 15px; | ||
margin-bottom: 30px; | ||
} | ||
} | ||
} | ||
|
||
.noData { | ||
text-align: center; | ||
} | ||
|
||
.card-container { | ||
background-color: #fff; | ||
box-shadow: 0px 10px 20px rgb(80 80 80 / 30%); | ||
max-width: 400px; | ||
height: 160px; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
padding: 20px 0px; | ||
border-radius: 8px; | ||
|
||
.first-container { | ||
width: 30%; | ||
|
||
img { | ||
width: auto; | ||
height: auto; | ||
} | ||
} | ||
|
||
.second-container { | ||
display: flex; | ||
flex-direction: column; | ||
width: 70%; | ||
justify-content: space-between; | ||
|
||
.top-container { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
padding: 0px 10px; | ||
|
||
.dots { | ||
cursor: pointer; | ||
} | ||
} | ||
|
||
.bottom-container { | ||
padding: 0px 10px; | ||
margin-top: 30px; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
.link { | ||
color: #0f71cb; | ||
cursor: pointer; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@media (max-width: 480px) { | ||
.company-certificate-main .container .mainContainer { | ||
padding: 0px !important; | ||
} | ||
|
||
.company-certificate-main .container .uploadBtn { | ||
width: 50%; | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
src/components/pages/CompanyCertificates/CompanyCertificateCard.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,70 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
|
||
import { useTranslation } from 'react-i18next' | ||
import { Logo, Typography } from '@catena-x/portal-shared-components' | ||
import './CompanyCertificate.scss' | ||
import { type ComapnyCertificateData } from 'features/companyCertification/companyCertificateApiSlice' | ||
import { Box } from '@mui/material' | ||
import { useState } from 'react' | ||
import MoreVertIcon from '@mui/icons-material/MoreVert' | ||
|
||
export default function CompanyCertificateCard({ | ||
item, | ||
}: Readonly<{ | ||
item: ComapnyCertificateData | ||
}>): JSX.Element { | ||
const { t } = useTranslation() | ||
const [dotsMenu, setDotsMenu] = useState(false) | ||
return ( | ||
<Box className="card-container"> | ||
<Box className="first-container"> | ||
<Logo /> | ||
</Box> | ||
<Box className="second-container"> | ||
<Box className="top-container"> | ||
<Typography variant="h4">{item.companyCertificateType}</Typography> | ||
<Box | ||
className="dots" | ||
onClick={() => { | ||
setDotsMenu(!dotsMenu) | ||
}} | ||
> | ||
<MoreVertIcon /> | ||
</Box> | ||
</Box> | ||
<Box className="bottom-container"> | ||
<Typography variant="label3"> | ||
{t('content.companyCertificate.validtill')} : {item.validTill} | ||
</Typography> | ||
<Box | ||
className="link" | ||
onClick={() => { | ||
// show overlay | ||
}} | ||
> | ||
<Typography variant="label3"> | ||
{t('content.companyCertificate.morelink')} | ||
</Typography> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
) | ||
} |
58 changes: 58 additions & 0 deletions
58
src/components/pages/CompanyCertificates/CompanyCertificateElements.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,58 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
|
||
import { useTranslation } from 'react-i18next' | ||
import { Grid } from '@mui/material' | ||
import { Typography } from '@catena-x/portal-shared-components' | ||
import './CompanyCertificate.scss' | ||
import { type ComapnyCertificateData } from 'features/companyCertification/companyCertificateApiSlice' | ||
import CompanyCertificateCard from './CompanyCertificateCard' | ||
|
||
export default function CompanyCertificateElements({ | ||
data, | ||
}: Readonly<{ | ||
data: ComapnyCertificateData[] | ||
}>): JSX.Element { | ||
const { t } = useTranslation() | ||
|
||
if (data?.length === 0) { | ||
return ( | ||
<Typography variant="body1" className="noData"> | ||
{t('content.companyCertificate.noData')} | ||
</Typography> | ||
) | ||
} | ||
|
||
return ( | ||
<Grid container spacing={2} className="company-certificate-section"> | ||
{data?.map((item: ComapnyCertificateData) => ( | ||
<Grid | ||
item | ||
xs={12} | ||
sm={6} | ||
md={6} | ||
className="company-certificate-card" | ||
key={item.companyCertificateType} | ||
> | ||
<CompanyCertificateCard item={item} /> | ||
</Grid> | ||
))} | ||
</Grid> | ||
) | ||
} |
Oops, something went wrong.