Skip to content

Commit

Permalink
Feat/fluo devnet promo (#123)
Browse files Browse the repository at this point in the history
* Add fluo devnet launch banner

* Small fix, update guide link

* Update link label

* Fix PR UI comments
  • Loading branch information
andrewsoon authored Aug 7, 2023
1 parent 1228849 commit 6abc383
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 1 deletion.
Binary file added src/@demex-info/assets/background/DevnetPromo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/@demex-info/constants/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ export const StaticLinks = {
CosmosIBC: "https://mapofzones.com/",
PolyNetworkAlliance: "https://www.poly.network/#/",
CarbonhubStake: "https://hub.carbon.network/stake",
FluoDocs: {
DevnetLaunch: "https://dev-app.dem.exchange/pools",
PublicDevnet: "https://guide.dem.exchange/community/incentivized-devnet-event",
Airdrop: "https://fluofinance.com/airdrop",
},
};

export function getNetworkQueryParam(net: CarbonSDK.Network) {
Expand Down
2 changes: 2 additions & 0 deletions src/@demex-info/layout/MainLayout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CarbonSDK } from "carbon-js-sdk";
import clsx from "clsx";
import React, { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { DevnetPromoBanner } from "./components/DevnetPromoBanner";
import Header from "./components/Header";

interface Props extends BoxProps { }
Expand Down Expand Up @@ -40,6 +41,7 @@ const MainLayout: React.FC<Props> = (props: Props) => {
const classes = useStyles();
return (
<main className={clsx(classes.app, className)} {...rest}>
<DevnetPromoBanner />
<Header />
{children}
</main>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { Box, Button, makeStyles, Theme, Typography, useMediaQuery, useTheme } from "@material-ui/core";
import React from "react";

import DevnetPromoBackground from "@demex-info/assets/background/DevnetPromo.png";
import DevnetPromoBackgroundMobile from "@demex-info/assets/background/DevnetPromoMobile.png";
import { StaticLinks } from "@demex-info/constants";

const DevnetPromoBanner: React.FC = () => {
const classes = useStyles();
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));

return (
<Box className={classes.bannerContainer}>
<Typography className={classes.bannerText}>Try Perp Pools on our Incentivized Public Devnet!&nbsp;&#128293;</Typography>
<Box className={classes.bannerButtonGroup}>
<Button
variant="contained"
href={StaticLinks.FluoDocs.DevnetLaunch}
target="_blank"
className={classes.bannerButton}
>
Try Now
</Button>
<Button
variant="outlined"
href={StaticLinks.FluoDocs.PublicDevnet}
target="_blank"
className={classes.bannerButtonOutlined}
>
{isMobile ? "Guide" : "Learn More"}
</Button>
<Button
variant="outlined"
href={StaticLinks.FluoDocs.Airdrop}
target="_blank"
className={classes.bannerButtonOutlined}
>
{isMobile ? "Airdrop" : "Check Airdrop Eligibility"}
</Button>
</Box>
</Box>
);
};


const useStyles = makeStyles((theme: Theme) => ({
bannerContainer: {
backgroundColor: theme.palette.background.secondary,
backgroundImage: `url(${DevnetPromoBackground})`,
color: theme.palette.text.primary,
padding: theme.spacing(1.5),
display: "flex",
gap: "8px",
justifyContent: "center",
alignItems: "center",
borderBottom: `1px solid ${theme.palette.divider}`,
zIndex: 1100, //zIndex for menu drawer is 1200
[theme.breakpoints.down("sm")]: {
backgroundImage: `url(${DevnetPromoBackgroundMobile})`,
flexDirection: "column",
padding: theme.spacing(2, 1.5),
},
},
bannerText: {
...theme.typography.body2,
textAlign: "center",
[theme.breakpoints.down("sm")]: {
...theme.typography.body3,
},
},
bannerButtonGroup: {
display: "flex",
gap: "8px",
},
bannerButton: {
"& .MuiButton-label": {
...theme.typography.title3,
},
},
bannerButtonOutlined: {
border: `1px solid ${theme.palette.text.disabled}!important`,
"& .MuiButton-label": {
...theme.typography.title3,
},
},
}));

export default DevnetPromoBanner;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DevnetPromoBanner } from "./DevnetPromoBanner";
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const useStyles = makeStyles((theme: Theme) => ({
backgroundColor: theme.palette.background.primary,
minHeight: "4rem",
padding: theme.spacing(0, 6),
position: "fixed",
position: "sticky",
top: 0,
width: `calc(100vw - ${theme.spacing(12)}px)`,
zIndex: 1100, //zIndex for menu drawer is 1200
Expand Down

0 comments on commit 6abc383

Please sign in to comment.