-
Notifications
You must be signed in to change notification settings - Fork 0
/
30-f0aa45a00d9f9a7ef1bc.js.map
1 lines (1 loc) · 6.24 KB
/
30-f0aa45a00d9f9a7ef1bc.js.map
1
{"version":3,"sources":["webpack:///./src/components/molecules/dashboard/ConfirmedCaseDigestAge.js","webpack:///./src/components/atoms/Row.js"],"names":["AgeWrapper","styled","Row","bps","between","up","AgeBox","Box","AgeTitle","h4","DataValue","span","ConfirmedCaseVisual","props","t","useTranslation","ageArray","age","nodes","genderAge","group","WarsCaseData","female","find","fieldValue","male","ageNumberArray","map","a","agePlot","mdUp","min","max","length","smDown","gender","median","edges","filter","e","node","parseInt","UnstyledRow","theme","typography","smallFontSize","FlexStartRow"],"mappings":"4RAWMA,EAAaC,YAAOC,KAAV,qFAAGD,CAAH,2EAGZE,IAAIC,QAAQ,KAAM,MAIlBD,IAAIE,GAAG,OAKLC,EAASL,YAAOM,KAAV,iFAAGN,CAAH,4BACRE,IAAIE,GAAG,OAKLG,EAAWP,IAAOQ,GAAV,mFAAGR,CAAH,sDAEVE,IAAIE,GAAG,OAMLK,EAAYT,IAAOU,KAAV,oFAAGV,CAAH,yCACXE,IAAIE,GAAG,OAMI,SAASO,EAAoBC,GAAQ,IAC1CC,EAAMC,cAAND,EADyC,SAIjCE,EAJiC,EAI/CC,IAAOC,MACaC,EAL2B,EAK/CA,UAAaC,MA0BTC,EAAe,CACnBL,WACAG,YAEAG,OAAQH,EAAUI,MAAK,SAAAN,GAAG,MAAuB,MAAnBA,EAAIO,cAClCC,KAAMN,EAAUI,MAAK,SAAAN,GAAG,MAAuB,MAAnBA,EAAIO,eAG5BE,EAAiBL,EAAaL,SAASW,KAAI,SAAAC,GAAC,OAAKA,EAAEX,OAEnDY,EACJ,oCACE,kBAAC,IAAD,KACE,kBAAC7B,EAAD,KACE,kBAACM,EAAD,KACE,kBAACE,EAAD,KAAWM,EAAE,iCACb,kBAAC,IAAD,CAAQgB,MAAI,GAAZ,MACA,kBAACpB,EAAD,QAAeI,EAAE,yBAA0B,CACzCiB,IAAKL,EAAe,GACpBM,IAAKN,EAAeL,EAAaL,SAASiB,OAAS,MAErD,kBAAC,IAAD,CAAQC,QAAM,GAAEpB,EAAE,2BAEpB,kBAACR,EAAD,KACE,kBAACE,EAAD,QAAcM,EAAE,0BAA2B,CACzCqB,OAAQrB,EAAE,oBAAoBO,EAAaI,KAAKD,eAElD,kBAAC,IAAD,CAAQM,MAAI,GAAZ,MACA,kBAACpB,EAAD,KACG0B,YACCf,EAAaI,KAAKY,MACfC,QAAO,SAAAC,GAAC,OAAIA,EAAEC,KAAKvB,OACnBU,KAAI,SAAAY,GAAC,OAAIE,SAASF,EAAEC,KAAKvB,UAGhC,kBAAC,IAAD,CAAQiB,QAAM,GAAEpB,EAAE,2BAEpB,kBAACR,EAAD,KACE,kBAACE,EAAD,QAAcM,EAAE,0BAA2B,CACzCqB,OAAQrB,EAAE,oBAAoBO,EAAaC,OAAOE,eAEpD,kBAAC,IAAD,CAAQM,MAAI,GAAZ,MACA,kBAACpB,EAAD,KACG0B,YACCf,EAAaC,OAAOe,MACjBC,QAAO,SAAAC,GAAC,OAAIA,EAAEC,KAAKvB,OACnBU,KAAI,SAAAY,GAAC,OAAIE,SAASF,EAAEC,KAAKvB,UAGhC,kBAAC,IAAD,CAAQiB,QAAM,GAAEpB,EAAE,8BAO5B,OAAO,oCAAGe,K,kCCnIZ,kIAGaa,EAAczC,YAAOM,KAAV,uEAAGN,CAAH,uGACT,SAAAY,GAAK,OAAIA,EAAM8B,MAAMC,WAAWC,iBAQlC3C,EAAMD,YAAOyC,GAAV,0DAAGzC,CAAH,uBAIH6C,EAAe7C,YAAOC,GAAV,wEAAGD,CAAH,6D","file":"30-f0aa45a00d9f9a7ef1bc.js","sourcesContent":["import React from \"react\"\nimport { useTranslation } from \"react-i18next\"\nimport { useStaticQuery, graphql } from \"gatsby\"\nimport styled from \"styled-components\"\nimport { Row } from \"@components/atoms/Row\"\nimport Box from \"@material-ui/core/Box\"\nimport { Hidden } from \"@material-ui/core\"\nimport { bps } from \"@/ui/theme\"\nimport { median } from \"@/utils\"\nimport { BasicCard } from \"@components/atoms/Card\"\n\nconst AgeWrapper = styled(Row)`\n flex-direction: row;\n\n ${bps.between(\"md\", \"lg\")} {\n flex-direction: column;\n }\n\n ${bps.up(\"lg\")} {\n flex-direction: row;\n }\n`\n\nconst AgeBox = styled(Box)`\n ${bps.up(\"md\")} {\n text-align: center;\n }\n`\n\nconst AgeTitle = styled.h4`\n display: inline;\n ${bps.up(\"md\")} {\n display: block;\n font-size: 18px;\n }\n`\n\nconst DataValue = styled.span`\n ${bps.up(\"md\")} {\n font-size: 48px;\n line-height: 1.4;\n }\n`\n\nexport default function ConfirmedCaseVisual(props) {\n const { t } = useTranslation()\n\n const {\n age: { nodes: ageArray },\n genderAge: { group: genderAge },\n } = useStaticQuery(\n graphql`\n query {\n age: allWarsCase(\n sort: { fields: age, order: ASC }\n filter: { type_en: { eq: \"Confirmed\" }, age: { ne: \"\" } }\n ) {\n nodes {\n age\n }\n }\n genderAge: allWarsCase(filter: { type_en: { eq: \"Confirmed\" } }) {\n group(field: gender) {\n edges {\n node {\n age\n }\n }\n totalCount\n fieldValue\n }\n }\n }\n `\n )\n const WarsCaseData = {\n ageArray,\n genderAge,\n\n female: genderAge.find(age => age.fieldValue === \"F\"),\n male: genderAge.find(age => age.fieldValue === \"M\"),\n }\n\n const ageNumberArray = WarsCaseData.ageArray.map(a => +a.age)\n\n const agePlot = (\n <>\n <BasicCard>\n <AgeWrapper>\n <AgeBox>\n <AgeTitle>{t(`cases_visual.age_range_title`)}</AgeTitle>\n <Hidden mdUp>: </Hidden>\n <DataValue>{`${t(`cases_visual.age_range`, {\n min: ageNumberArray[0],\n max: ageNumberArray[WarsCaseData.ageArray.length - 1],\n })}`}</DataValue>\n <Hidden smDown>{t(\"cases_visual.age_unit\")}</Hidden>\n </AgeBox>\n <AgeBox>\n <AgeTitle>{`${t(`cases_visual.median_age`, {\n gender: t(`dashboard.gender_${WarsCaseData.male.fieldValue}`),\n })}`}</AgeTitle>\n <Hidden mdUp>: </Hidden>\n <DataValue>\n {median(\n WarsCaseData.male.edges\n .filter(e => e.node.age)\n .map(e => parseInt(e.node.age))\n )}\n </DataValue>\n <Hidden smDown>{t(\"cases_visual.age_unit\")}</Hidden>\n </AgeBox>\n <AgeBox>\n <AgeTitle>{`${t(`cases_visual.median_age`, {\n gender: t(`dashboard.gender_${WarsCaseData.female.fieldValue}`),\n })}`}</AgeTitle>\n <Hidden mdUp>: </Hidden>\n <DataValue>\n {median(\n WarsCaseData.female.edges\n .filter(e => e.node.age)\n .map(e => parseInt(e.node.age))\n )}\n </DataValue>\n <Hidden smDown>{t(\"cases_visual.age_unit\")}</Hidden>\n </AgeBox>\n </AgeWrapper>\n </BasicCard>\n </>\n )\n\n return <>{agePlot}</>\n}\n","import styled from \"styled-components\"\nimport Box from \"@material-ui/core/Box\"\n\nexport const UnstyledRow = styled(Box)`\n font-size: ${props => props.theme.typography.smallFontSize}px;\n margin: 0;\n padding: 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n`\n\nexport const Row = styled(UnstyledRow)`\n margin: 6px 0 6px;\n`\n\nexport const FlexStartRow = styled(Row)`\n && {\n justify-content: flex-start;\n div {\n margin-right: 64px;\n }\n }\n`\n"],"sourceRoot":""}