-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83b35fe
commit 7eadeff
Showing
12 changed files
with
236 additions
and
19 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,106 @@ | ||
@use '../../styles/globals'; | ||
|
||
.object-card { | ||
display: flex; | ||
flex-direction: row; | ||
margin: 10px; | ||
padding: 20px; | ||
border: solid; | ||
border-width: 1px 0px 1px 0px; | ||
border-color: var(--rs-gray-100); | ||
|
||
@media (max-width: globals.$mobile) { | ||
flex-direction: column; | ||
gap: 30px; | ||
} | ||
} | ||
|
||
.img { | ||
width: 20vw; | ||
max-height: 50vh; | ||
height: 100%; | ||
padding: 20px; | ||
object-fit: cover; | ||
|
||
@media (max-width: globals.$mobile) { | ||
width: 100%; | ||
} | ||
} | ||
|
||
.left { | ||
display: flex; | ||
flex-direction: row; | ||
gap: 30px; | ||
justify-content: flex-end; | ||
|
||
@media (max-width: globals.$mobile) { | ||
justify-content: space-evenly; | ||
padding-top: 20px; | ||
font-size: 1.4rem; | ||
} | ||
} | ||
|
||
.right { | ||
display: flex; | ||
align-items: center; | ||
@media (max-width: globals.$mobile) { | ||
justify-content: center; | ||
} | ||
} | ||
|
||
// TODO this is ".role". make it | ||
.role { | ||
display: flex; | ||
align-items: center; | ||
text-transform: lowercase; | ||
font-weight: 100; | ||
letter-spacing: 1px; | ||
// color: var(--rs-gray-600); | ||
// color: #014a40; | ||
} | ||
|
||
.left-right { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
width: 30vw; | ||
|
||
@media (max-width: globals.$mobile) { | ||
width: 60vw; | ||
} | ||
} | ||
|
||
.pseudo-tombstone { | ||
border: solid; | ||
border-width: 0px 0px 0px 1px; | ||
border-color: var(--rs-gray-400); | ||
padding-left: 20px; | ||
} | ||
|
||
.thumbnail-holder { | ||
:not a[href] { | ||
display: hidden; | ||
} | ||
a[href=""] { | ||
display: hidden; | ||
} | ||
} | ||
|
||
.obj-name-link { | ||
font-size: 1.1em; | ||
font-weight: bold; | ||
text-decoration: none; | ||
} | ||
|
||
.title { | ||
} | ||
|
||
.display-date { | ||
padding: 5px 0px 0px 0px; | ||
font-style: italic; | ||
} | ||
|
||
.display-medium { | ||
padding: 10px 0px 0px 0px; | ||
font-weight: 300; | ||
} |
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,44 @@ | ||
|
||
import styles from './ObjectCard.module.scss'; | ||
|
||
interface Props { | ||
payload: MainRecord; | ||
} | ||
|
||
export const ObjectCard = ({ payload }: Props) => { | ||
const thumbnailp = payload.Link!=null ? | ||
<div className={ styles['thumbnail-holder'] }> | ||
{ /* TODO should I use another image components e.g. Image, etc...? */ } | ||
<a href={ payload.Link } target="_blank"> | ||
<img className={ styles['img'] } src={ payload.Link }/> | ||
</a> | ||
</div> : | ||
<></>; | ||
|
||
return ( | ||
<div className={ styles['object-card'] }> | ||
<div className={ styles['left'] }> | ||
<div className={ styles['role'] }> | ||
<span>{ payload.Role }</span> | ||
</div> | ||
<div className={ styles['left-right'] }> | ||
<div className={ styles['pseudo-tombstone'] }> | ||
<div className={ styles['title'] }> | ||
<a className={ styles['obj-name-link'] } href={ `/object/${payload.Object_ID}` }> | ||
{ payload.Title } | ||
</a> | ||
</div> | ||
<div className={ styles['display-date'] }>{ payload.Dated }</div> | ||
{ payload.Medium!=null ? | ||
<div className={ styles['display-medium'] }>{ payload.Medium }</div> : | ||
<div></div> } | ||
</div> | ||
</div> | ||
</div> | ||
{ /* HACK TERRIBLE! Adapt ThumbnailHolder! That's why you moved it */ } | ||
<div className={ styles['right'] }> | ||
{ thumbnailp } | ||
</div> | ||
</div> | ||
); | ||
}; |
8 changes: 7 additions & 1 deletion
8
...ew/components/ThumbnailHolder.module.scss → ...umbnailHolder/ThumbnailHolder.module.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
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,38 @@ | ||
@use '../../../styles/globals'; | ||
|
||
// TODO MOBILE | ||
// TODO MOBILE | ||
// TODO MOBILE | ||
// TODO MOBILE | ||
// TODO MOBILE | ||
|
||
.constituent-view { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
|
||
@media (max-width: globals.$mobile) { | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
} | ||
|
||
.left { | ||
display: flex; | ||
width: 50vw; | ||
} | ||
|
||
.right { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.obj-cards { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
@media (max-width: globals.$mobile) { | ||
gap: 10px; | ||
} | ||
} | ||
|
25 changes: 20 additions & 5 deletions
25
app/components/Viewers/ConstituentView/ConstituentView.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 |
---|---|---|
@@ -1,15 +1,30 @@ | ||
|
||
import { ObjectCard } from "@/app/components/ObjectCard/ObjectCard"; | ||
import { KeyValueTable } from "@/app/components/KeyValueTable/KeyValueTable"; | ||
import styles from './ConstituentView.module.scss'; | ||
|
||
interface Props { | ||
conPayload: ConstituentsRecord; | ||
conxobjPayload: Array<ConstituentsxobjectsRecord>; | ||
conxobjPayload: Array<MainRecord>; // TODO (not really) | ||
} | ||
|
||
export const ConstituentView = ({ conPayload, conxobjPayload }: Props) => { | ||
|
||
const objCards = conxobjPayload.map((i: MainRecord) => { | ||
return <ObjectCard payload={ i } /> | ||
}); | ||
|
||
return ( | ||
<> | ||
<pre>{ JSON.stringify(conPayload, null, 2) }</pre> | ||
<pre>{ JSON.stringify(conxobjPayload, null, 2) }</pre> | ||
</> | ||
<div className={ styles['constituent-view'] }> | ||
<div className={ styles['left'] }> | ||
<KeyValueTable payload={ conPayload } /> | ||
</div> | ||
<div className={ styles['right'] }> | ||
<div className={ styles['obj-cards'] }> | ||
{ objCards } | ||
</div> | ||
</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
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