@chakra-ui/core#Stat JavaScript Examples
The following examples show how to use
@chakra-ui/core#Stat.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: launch-pad.js From space-rockets-challenge with MIT License | 6 votes |
function LocationAndVehicles({ launchPad }) {
return (
<SimpleGrid columns={[1, 1, 2]} borderWidth="1px" p="4" borderRadius="md">
<Stat>
<StatLabel display="flex">
<Box as={MapPin} width="1em" />{" "}
<Box ml="2" as="span">
Location
</Box>
</StatLabel>
<StatNumber fontSize="xl">{launchPad.location.name}</StatNumber>
<StatHelpText>{launchPad.location.region}</StatHelpText>
</Stat>
<Stat>
<StatLabel display="flex">
<Box as={Navigation} width="1em" />{" "}
<Box ml="2" as="span">
Vehicles
</Box>
</StatLabel>
<StatNumber fontSize="xl">
{launchPad.vehicles_launched.join(", ")}
</StatNumber>
</Stat>
</SimpleGrid>
);
}
Example #2
Source File: launch.js From space-rockets-challenge with MIT License | 6 votes |
function TimeAndLocation({ launch }) {
return (
<SimpleGrid columns={[1, 1, 2]} borderWidth="1px" p="4" borderRadius="md">
<Stat>
<StatLabel display="flex">
<Box as={Watch} width="1em" />{" "}
<Box ml="2" as="span">
Launch Date
</Box>
</StatLabel>
<StatNumber fontSize={["md", "xl"]}>
{formatDateTime(launch.launch_date_local)}
</StatNumber>
<StatHelpText>{timeAgo(launch.launch_date_utc)}</StatHelpText>
</Stat>
<Stat>
<StatLabel display="flex">
<Box as={MapPin} width="1em" />{" "}
<Box ml="2" as="span">
Launch Site
</Box>
</StatLabel>
<StatNumber fontSize={["md", "xl"]}>
<Link
as={RouterLink}
to={`/launch-pads/${launch.launch_site.site_id}`}
>
{launch.launch_site.site_name_long}
</Link>
</StatNumber>
<StatHelpText>{launch.launch_site.site_name}</StatHelpText>
</Stat>
</SimpleGrid>
);
}
Example #3
Source File: launch.js From space-rockets-challenge with MIT License | 5 votes |
function RocketInfo({ launch }) {
const cores = launch.rocket.first_stage.cores;
return (
<SimpleGrid
columns={[1, 1, 2]}
borderWidth="1px"
mt="4"
p="4"
borderRadius="md"
>
<Stat>
<StatLabel display="flex">
<Box as={Navigation} width="1em" />{" "}
<Box ml="2" as="span">
Rocket
</Box>
</StatLabel>
<StatNumber fontSize={["md", "xl"]}>
{launch.rocket.rocket_name}
</StatNumber>
<StatHelpText>{launch.rocket.rocket_type}</StatHelpText>
</Stat>
<StatGroup>
<Stat>
<StatLabel display="flex">
<Box as={Layers} width="1em" />{" "}
<Box ml="2" as="span">
First Stage
</Box>
</StatLabel>
<StatNumber fontSize={["md", "xl"]}>
{cores.map((core) => core.core_serial).join(", ")}
</StatNumber>
<StatHelpText>
{cores.every((core) => core.land_success)
? cores.length === 1
? "Recovered"
: "All recovered"
: "Lost"}
</StatHelpText>
</Stat>
<Stat>
<StatLabel display="flex">
<Box as={Layers} width="1em" />{" "}
<Box ml="2" as="span">
Second Stage
</Box>
</StatLabel>
<StatNumber fontSize={["md", "xl"]}>
Block {launch.rocket.second_stage.block}
</StatNumber>
<StatHelpText>
Payload:{" "}
{launch.rocket.second_stage.payloads
.map((payload) => payload.payload_type)
.join(", ")}
</StatHelpText>
</Stat>
</StatGroup>
</SimpleGrid>
);
}