-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #284 from sunrise-stake/feature/referral
Referral UI
- Loading branch information
Showing
45 changed files
with
1,335 additions
and
606 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
pull_request: | ||
|
||
env: | ||
solana_version: stable | ||
solana_version: v1.14.17 | ||
VERBOSE: 1 | ||
|
||
jobs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Link, type LinkProps, useLocation } from "react-router-dom"; | ||
import { type FC, type PropsWithChildren } from "react"; | ||
|
||
export const LinkWithQuery: FC<PropsWithChildren & LinkProps> = ({ | ||
children, | ||
to, | ||
...props | ||
}) => { | ||
const { search } = useLocation(); | ||
|
||
const linkParams = typeof to === "string" ? { pathname: to } : to; | ||
|
||
return ( | ||
<Link | ||
to={{ | ||
...linkParams, | ||
search, | ||
}} | ||
{...props} | ||
> | ||
{children} | ||
</Link> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React, { type FC } from "react"; | ||
import { useScript } from "../hooks"; | ||
|
||
export const Tweet: FC<{ | ||
tweet: string; | ||
url?: string; | ||
size?: "small" | "medium" | "large"; | ||
}> = ({ tweet, url, size = "large" }) => { | ||
useScript("https://platform.x.com/widgets.js"); | ||
return ( | ||
<a | ||
href="https://twitter.com/share?ref_src=twsrc%5Etfw" | ||
className="twitter-share-button" | ||
data-size={size} | ||
data-text={tweet} | ||
data-url={url} | ||
data-related="sunrisestake" | ||
data-show-count="false" | ||
> | ||
Tweet | ||
</a> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { type FC, type PropsWithChildren, type ReactNode } from "react"; | ||
import clx from "classnames"; | ||
|
||
interface CardProps { | ||
title?: string; | ||
image?: ReactNode; | ||
orientation?: "horizontal" | "vertical"; | ||
size?: "small" | "medium" | "large"; | ||
} | ||
|
||
export const Card: FC<PropsWithChildren & CardProps> = ({ | ||
children, | ||
image, | ||
title, | ||
orientation = "vertical", | ||
size = "medium", | ||
}) => ( | ||
<div | ||
className={clx( | ||
orientation === "horizontal" && "card-side", | ||
size === "small" | ||
? "w-32 h-32 p-2" | ||
: size === "medium" | ||
? "w-48 h-48 p-4" | ||
: "w-128 h-128 p-4", | ||
"card glass" | ||
)} | ||
> | ||
{image !== undefined && <figure className="min-h-2/3">{image}</figure>} | ||
<div | ||
className={clx( | ||
"card-body items-center content-center", | ||
size === "small" ? "p-1" : size === "medium" ? "p-1" : "p-3" | ||
)} | ||
> | ||
{title !== undefined && ( | ||
<h2 | ||
className={clx( | ||
"card-title text-center", | ||
size === "small" && "text-s" | ||
)} | ||
> | ||
{title} | ||
</h2> | ||
)} | ||
{children} | ||
</div> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React, { | ||
type ForwardRefRenderFunction, | ||
type PropsWithChildren, | ||
type ReactNode, | ||
} from "react"; | ||
import clx from "classnames"; | ||
|
||
interface TitleProps { | ||
children: ReactNode; | ||
} | ||
|
||
const Title: React.FC<TitleProps> = ({ children }) => ( | ||
<div className="h-[25vh] flex items-center justify-center">{children}</div> | ||
); | ||
|
||
interface MainProps { | ||
children: ReactNode; | ||
} | ||
|
||
const Main: React.FC<MainProps> = ({ children }) => ( | ||
<div | ||
className={`h-[75vh] bg-wood-sm bg-cover overflow-y-auto pt-5 mb-5 md:bg-wood-md lg:bg-wood-lg lg:flex lg:items-center`} | ||
> | ||
{children} | ||
</div> | ||
); | ||
|
||
const _TopicContainer: ForwardRefRenderFunction< | ||
HTMLDivElement, | ||
{ | ||
className?: string; | ||
active?: boolean; | ||
titleContents: ReactNode; | ||
} & React.HTMLAttributes<HTMLElement> & | ||
PropsWithChildren | ||
> = ({ children, titleContents, className, active = false, ...rest }, ref) => ( | ||
<div | ||
className={clx( | ||
"relative flex flex-col justify-start items-center", | ||
className | ||
)} | ||
ref={ref} | ||
{...rest} | ||
> | ||
<Title>{titleContents}</Title> | ||
<Main>{children}</Main> | ||
</div> | ||
); | ||
|
||
export const TopicContainer = React.forwardRef(_TopicContainer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.