Skip to content

Commit

Permalink
feat(FileCitation): add to skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
MellyGray committed Dec 21, 2023
1 parent 6d34d58 commit 4482c92
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 11 deletions.
3 changes: 1 addition & 2 deletions public/locales/en/citationBlock.json
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
{"learnAbout": "Learn About",
"standards": "Data Citation Standards"}
{ "learnAbout": "Learn About", "standards": "Data Citation Standards" }
4 changes: 2 additions & 2 deletions public/locales/en/file.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"metadata": "Metadata"
},
"subtext": "This file is part of \"{{datasetTitle}}\".",
"datasetCitationTitle": "Dataset Citation",
"fileCitationTitle": "File Citation"
"datasetCitationTitle": "Dataset Citation",
"fileCitationTitle": "File Citation"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "node_modules/@iqss/dataverse-design-system/src/lib/assets/styles/design-tokens/colors.module";

.container {
margin: 0 0 20px 0;
margin: 0 0 20px;
padding: 10px 0;
border: 1px solid $dv-info-border-color;
}
Expand Down
21 changes: 16 additions & 5 deletions src/sections/file/FileSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
import styles from '../dataset/Dataset.module.scss'
import styles from './File.module.scss'
import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'
import { Tabs } from '@iqss/dataverse-design-system'
import { Col, Row, Tabs } from '@iqss/dataverse-design-system'
import { useTranslation } from 'react-i18next'

export function FileSkeleton() {
const { t } = useTranslation('file')
return (
<SkeletonTheme>
<article data-testid="file-skeleton">
<header className={styles.header}>
<h1>
<Skeleton width="30%" />
<Skeleton width="15%" />
</h1>
<Skeleton width="10%" />
<Skeleton width="20%" />
</header>
<div className={styles.container}>
<Row>
<Col sm={9}>
<span className={styles['citation-title']}>{t('fileCitationTitle')}</span>
<Skeleton height="80px" style={{ marginBottom: 20 }} />
<span className={styles['citation-title']}>{t('datasetCitationTitle')}</span>
<Skeleton height="80px" style={{ marginBottom: 20 }} />
</Col>
</Row>
<Tabs defaultActiveKey="metadata">
<Tabs.Tab eventKey="metadata" title="Metadata">
<Skeleton height="1000px" style={{ marginTop: 20 }} />
<></>
</Tabs.Tab>
</Tabs>
<div className={styles['separation-line']}></div>
</div>
</article>
</SkeletonTheme>
Expand Down
2 changes: 1 addition & 1 deletion src/sections/file/file-citation/FileCitation.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "node_modules/@iqss/dataverse-design-system/src/lib/assets/styles/design-tokens/colors.module";

.container {
margin: 0 0 20px 0;
margin: 0 0 20px;
padding: 10px 0;
border: 1px solid $dv-secondary-color;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('DatasetCard', () => {
cy.findByText(/Finch, Fiona, 2023, "Darwin's Finches"/)
.should('exist')
.parent()
.parent()
.should('have.class', styles['citation-box'])
cy.findByText(dataset.abbreviatedDescription).should('exist')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('DatasetCardInfo', () => {
cy.findByText(/Finch, Fiona, 2023, "Darwin's Finches"/)
.should('exist')
.parent()
.parent()
.should('have.class', styles['citation-box'])
cy.findByText(dataset.abbreviatedDescription).should('exist')
})
Expand All @@ -23,6 +24,7 @@ describe('DatasetCardInfo', () => {
cy.findByText(/Finch, Fiona, 2023, "Darwin's Finches"/)
.should('exist')
.parent()
.parent()
.should('have.class', styles['citation-box-deaccessioned'])
})
})

0 comments on commit 4482c92

Please sign in to comment.