File tree Expand file tree Collapse file tree 3 files changed +41
-25
lines changed
Expand file tree Collapse file tree 3 files changed +41
-25
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ export const Explore = (): JSX.Element => {
109109 created = { dataset . created }
110110 description = { dataset . description }
111111 thumbnailId = { dataset . thumbnail_id }
112- publicView = { true }
112+ publicView = { false }
113113 frozen = { dataset . frozen }
114114 frozenVersionNum = { dataset . frozen_version_num }
115115 status = { dataset . status }
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
1515import { Download } from "@mui/icons-material" ;
1616import { generateThumbnailUrl } from "../../utils/visualization" ;
1717import config from "../../app.config" ;
18+ import Chip from "@mui/material/Chip" ;
1819
1920type DatasetCardProps = {
2021 id ?: string ;
@@ -132,17 +133,42 @@ export default function DatasetCard(props: DatasetCardProps) {
132133 < Download />
133134 </ IconButton >
134135 </ Tooltip >
135- < Typography > { status } </ Typography >
136- { /*<Tooltip title="Favorite">*/ }
137- { /* <IconButton color="primary" aria-label="favorite" sx={{mr: 3}} disabled>*/ }
138- { /* <Favorite/>*/ }
139- { /* </IconButton>*/ }
140- { /*</Tooltip>*/ }
141- { /*<Tooltip title="Share">*/ }
142- { /* <IconButton color="primary" aria-label="share" sx={{mr: 3}} disabled>*/ }
143- { /* <Share/>*/ }
144- { /* </IconButton>*/ }
145- { /*</Tooltip>*/ }
136+ { ( ( ) => {
137+ switch ( status ) {
138+ case "PUBLIC" :
139+ return (
140+ < Tooltip title = "Anyone on the internet can access this dataset" >
141+ < Chip
142+ label = { status ?. toLowerCase ( ) }
143+ color = "primary"
144+ size = "small"
145+ />
146+ </ Tooltip >
147+ ) ;
148+ case "AUTHENTICATED" :
149+ return (
150+ < Tooltip title = "Only users who have logged in can access this dataset" >
151+ < Chip
152+ label = { status ?. toLowerCase ( ) }
153+ color = "primary"
154+ size = "small"
155+ />
156+ </ Tooltip >
157+ ) ;
158+ case "PRIVATE" :
159+ return (
160+ < Tooltip title = "Only users given specific permissions can access this dataset" >
161+ < Chip
162+ label = { status ?. toLowerCase ( ) }
163+ color = "primary"
164+ size = "small"
165+ />
166+ </ Tooltip >
167+ ) ;
168+ default :
169+ return null ;
170+ }
171+ } ) ( ) }
146172 </ CardActions >
147173 </ Card >
148174 ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ import { Download } from "@mui/icons-material";
1616import { generateThumbnailUrl } from "../../utils/visualization" ;
1717import config from "../../app.config" ;
1818// import {Favorite, Share} from "@material-ui/icons";
19+ import PublicIcon from "@mui/icons-material/Public" ;
20+ import Chip from "@mui/material/Chip" ;
1921
2022type PublicDatasetCardProps = {
2123 id ?: string ;
@@ -120,28 +122,16 @@ export default function PublicDatasetCard(props: PublicDatasetCardProps) {
120122 </ CardContent >
121123 </ CardActionArea >
122124 ) }
123- < CardActions sx = { { pb : 0 , justifyContent : "space-between" } } >
125+ < CardActions sx = { { pb : 0 , pr : 0 } } >
124126 < Tooltip title = "Download" >
125127 < IconButton
126128 href = { `${ config . hostname } /api/v2/public_datasets/${ id } /download` }
127129 color = "primary"
128130 aria-label = "download"
129- sx = { { mr : 3 } }
130131 >
131132 < Download />
132133 </ IconButton >
133134 </ Tooltip >
134- < Typography > { status } </ Typography >
135- { /*<Tooltip title="Favorite">*/ }
136- { /* <IconButton color="primary" aria-label="favorite" sx={{mr: 3}} disabled>*/ }
137- { /* <Favorite/>*/ }
138- { /* </IconButton>*/ }
139- { /*</Tooltip>*/ }
140- { /*<Tooltip title="Share">*/ }
141- { /* <IconButton color="primary" aria-label="share" sx={{mr: 3}} disabled>*/ }
142- { /* <Share/>*/ }
143- { /* </IconButton>*/ }
144- { /*</Tooltip>*/ }
145135 </ CardActions >
146136 </ Card >
147137 ) ;
You can’t perform that action at this time.
0 commit comments