|
| 1 | +import { |
| 2 | + DrefTwoIcon, |
| 3 | + MailIcon, |
| 4 | + ShareLineIcon, |
| 5 | +} from '@ifrc-go/icons'; |
| 6 | +import { |
| 7 | + Container, |
| 8 | + DropdownMenu, |
| 9 | + TextInput, |
| 10 | + TextOutput, |
| 11 | +} from '@ifrc-go/ui'; |
| 12 | +import { useTranslation } from '@ifrc-go/ui/hooks'; |
| 13 | + |
| 14 | +import Link from '#components/Link'; |
| 15 | +import Page from '#components/Page'; |
| 16 | + |
| 17 | +import i18n from './i18n.json'; |
| 18 | +import styles from './styles.module.css'; |
| 19 | + |
| 20 | +// TODO: Does this need translation? |
| 21 | +const emailSubject = encodeURIComponent('Explore Montandon Data'); |
| 22 | +const linkToMontandon = 'https://radiantearth.github.io/stac-browser/#/external/montandon-eoapi-stage.ifrc.org/stac/'; |
| 23 | +const emailBody = encodeURIComponent(`Sharing with you a link to Montandon API: ${linkToMontandon}`); |
| 24 | +const mailtoLink = `mailto:?subject=${emailSubject}&body=${emailBody}`; |
| 25 | + |
| 26 | +const noOp = () => {}; |
| 27 | + |
| 28 | +/** @knipignore */ |
| 29 | +// eslint-disable-next-line import/prefer-default-export |
| 30 | +export function Component() { |
| 31 | + const strings = useTranslation(i18n); |
| 32 | + |
| 33 | + return ( |
| 34 | + <Page |
| 35 | + className={styles.montandonLandingPage} |
| 36 | + title={strings.montandonPageTitle} |
| 37 | + heading={strings.montandonHeading} |
| 38 | + description={strings.montandonHeadingDescription} |
| 39 | + mainSectionClassName={styles.content} |
| 40 | + actions={( |
| 41 | + <> |
| 42 | + <DropdownMenu |
| 43 | + label={strings.sourcePopupTitle} |
| 44 | + icons={<DrefTwoIcon className={styles.icon} />} |
| 45 | + preferredPopupWidth={30} |
| 46 | + withoutDropdownIcon |
| 47 | + persistent |
| 48 | + > |
| 49 | + <Container |
| 50 | + heading={strings.sourcePopupTitle} |
| 51 | + withHeaderBorder |
| 52 | + withInternalPadding |
| 53 | + contentViewType="vertical" |
| 54 | + > |
| 55 | + <div className={styles.stacDescription}> |
| 56 | + <TextOutput |
| 57 | + strongLabel |
| 58 | + label={strings.stacIdLabel} |
| 59 | + value={strings.stacIdValue} |
| 60 | + /> |
| 61 | + <TextOutput |
| 62 | + strongLabel |
| 63 | + label={strings.stacVersionLabel} |
| 64 | + value={strings.stacVersionValue} |
| 65 | + /> |
| 66 | + <TextOutput |
| 67 | + strongLabel |
| 68 | + label={strings.validLabel} |
| 69 | + value={strings.validValue} |
| 70 | + /> |
| 71 | + <div className={styles.separator} /> |
| 72 | + {strings.stacLocationText} |
| 73 | + <TextInput |
| 74 | + name="link" |
| 75 | + value="https://montandon-eoapi-stage.ifrc.org/stac/" |
| 76 | + onChange={noOp} |
| 77 | + readOnly |
| 78 | + /> |
| 79 | + </div> |
| 80 | + </Container> |
| 81 | + </DropdownMenu> |
| 82 | + <DropdownMenu |
| 83 | + icons={<ShareLineIcon className={styles.icon} />} |
| 84 | + label={strings.sharePopupTitle} |
| 85 | + withoutDropdownIcon |
| 86 | + preferredPopupWidth={30} |
| 87 | + persistent |
| 88 | + > |
| 89 | + <Container |
| 90 | + heading={strings.sharePopupTitle} |
| 91 | + withHeaderBorder |
| 92 | + withInternalPadding |
| 93 | + withFooterBorder |
| 94 | + contentViewType="vertical" |
| 95 | + footerContent={( |
| 96 | + <Link |
| 97 | + href={mailtoLink} |
| 98 | + icons={<MailIcon className={styles.icon} />} |
| 99 | + variant="secondary" |
| 100 | + external |
| 101 | + > |
| 102 | + {strings.emailLabel} |
| 103 | + </Link> |
| 104 | + )} |
| 105 | + > |
| 106 | + {strings.shareUrlLabel} |
| 107 | + <Link |
| 108 | + href="https://radiantearth.github.io/stac-browser/#/external/montandon-eoapi-stage.ifrc.org/stac/" |
| 109 | + variant="tertiary" |
| 110 | + external |
| 111 | + > |
| 112 | + https://radiantearth.github.io/stac-browser/#/external/montandon-eoapi-stage.ifrc.org/stac/ |
| 113 | + </Link> |
| 114 | + </Container> |
| 115 | + </DropdownMenu> |
| 116 | + </> |
| 117 | + )} |
| 118 | + infoContainerClassName={styles.iframeEmbed} |
| 119 | + info={( |
| 120 | + <iframe |
| 121 | + className={styles.iframe} |
| 122 | + src="https://www.youtube.com/embed/BEWxqYfrQek" |
| 123 | + title={strings.videoTitle} |
| 124 | + allow="" |
| 125 | + allowFullScreen |
| 126 | + /> |
| 127 | + )} |
| 128 | + > |
| 129 | + <Container |
| 130 | + className={styles.resources} |
| 131 | + contentViewType="grid" |
| 132 | + numPreferredGridContentColumns={3} |
| 133 | + spacing="comfortable" |
| 134 | + > |
| 135 | + <Container |
| 136 | + className={styles.guideCard} |
| 137 | + heading={strings.resources} |
| 138 | + contentViewType="vertical" |
| 139 | + withHeaderBorder |
| 140 | + withInternalPadding |
| 141 | + > |
| 142 | + <Link |
| 143 | + href="https://github.com/IFRCGo/monty-stac-extension/blob/main/README.md" |
| 144 | + external |
| 145 | + withLinkIcon |
| 146 | + > |
| 147 | + {strings.visitGithub} |
| 148 | + </Link> |
| 149 | + <Link |
| 150 | + href="https://go-wiki.ifrc.org/en/home" |
| 151 | + external |
| 152 | + withLinkIcon |
| 153 | + > |
| 154 | + {strings.goWiki} |
| 155 | + </Link> |
| 156 | + <Link |
| 157 | + href="https://montandon-eoapi-stage.ifrc.org/stac/api" |
| 158 | + external |
| 159 | + withLinkIcon |
| 160 | + > |
| 161 | + {strings.apiDescription} |
| 162 | + </Link> |
| 163 | + <Link |
| 164 | + href="https://montandon-eoapi-stage.ifrc.org/stac/api.html" |
| 165 | + external |
| 166 | + withLinkIcon |
| 167 | + > |
| 168 | + {strings.apiDocumentation} |
| 169 | + </Link> |
| 170 | + </Container> |
| 171 | + |
| 172 | + <Container |
| 173 | + className={styles.guideCard} |
| 174 | + heading={strings.blogPosts} |
| 175 | + contentViewType="vertical" |
| 176 | + withHeaderBorder |
| 177 | + withInternalPadding |
| 178 | + > |
| 179 | + <Link |
| 180 | + href="https://ifrcgoproject.medium.com/toward-a-more-comprehensive-understanding-of-disasters-fc422d65377" |
| 181 | + external |
| 182 | + withLinkIcon |
| 183 | + > |
| 184 | + {strings.leveragingDataBlogPostTitle} |
| 185 | + </Link> |
| 186 | + |
| 187 | + <Link |
| 188 | + href="https://ifrcgoproject.medium.com/scaled-up-ambitions-require-scaled-up-systems-4a92456fab59" |
| 189 | + external |
| 190 | + withLinkIcon |
| 191 | + > |
| 192 | + {strings.scaledUpSystemsBlogPostTitle} |
| 193 | + </Link> |
| 194 | + </Container> |
| 195 | + |
| 196 | + <Container |
| 197 | + className={styles.guideCard} |
| 198 | + heading={strings.contact} |
| 199 | + contentViewType="vertical" |
| 200 | + withHeaderBorder |
| 201 | + withInternalPadding |
| 202 | + > |
| 203 | + <Link |
| 204 | + |
| 205 | + variant="primary" |
| 206 | + external |
| 207 | + > |
| 208 | + |
| 209 | + </Link> |
| 210 | + <div> |
| 211 | + <div className={styles.contactInformation}> |
| 212 | + {strings.contactName} |
| 213 | + </div> |
| 214 | + <div> |
| 215 | + {strings.contactInfo} |
| 216 | + </div> |
| 217 | + </div> |
| 218 | + <Link |
| 219 | + |
| 220 | + variant="tertiary" |
| 221 | + external |
| 222 | + > |
| 223 | + |
| 224 | + </Link> |
| 225 | + </Container> |
| 226 | + |
| 227 | + </Container> |
| 228 | + <Container |
| 229 | + contentViewType="vertical" |
| 230 | + heading="Other links" |
| 231 | + withHeaderBorder |
| 232 | + > |
| 233 | + <Link |
| 234 | + href="https://montandon-eoapi-stage.ifrc.org/stac/api.html" |
| 235 | + withUnderline |
| 236 | + withLinkIcon |
| 237 | + external |
| 238 | + > |
| 239 | + {strings.accessAPILabel} |
| 240 | + </Link> |
| 241 | + <Link |
| 242 | + href="https://radiantearth.github.io/stac-browser/#/external/montandon-eoapi-stage.ifrc.org/stac/" |
| 243 | + withUnderline |
| 244 | + withLinkIcon |
| 245 | + external |
| 246 | + > |
| 247 | + {strings.exploreRadiantEarthLabel} |
| 248 | + </Link> |
| 249 | + </Container> |
| 250 | + </Page> |
| 251 | + ); |
| 252 | +} |
| 253 | + |
| 254 | +Component.displayName = 'montandonLandingPage'; |
0 commit comments