Skip to content

Commit

Permalink
support override content
Browse files Browse the repository at this point in the history
  • Loading branch information
worlddlckgh committed Aug 4, 2023
1 parent 675a153 commit e4d1395
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/CometWalletButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { CurrentUserBadge } from "../CurrentUserBadge";
import { useCometKit } from "../../contexts/CometKitProvider";
import ModalDialog from "../ModalDialog";
import CometWalletModal from '../../components/CometWalletModal';
import tw from "twin.macro";

const CometWalletButton: React.FC<{ buttonContent?: ReactNode; buttonClassName?: string; currentUserClassName?: string; }> = ({ buttonContent, buttonClassName: className, currentUserClassName }) => {
const CometWalletButton: React.FC<{ overrideContent?: ReactNode; buttonClassName?: string; currentUserClassName?: string; }> = ({ overrideContent, buttonClassName: className, currentUserClassName }) => {
const [shouldRender, setShouldRender] = React.useState(false);
const { disconnect, connecting, connected } = useCometKit();

Expand Down Expand Up @@ -41,11 +42,13 @@ const CometWalletButton: React.FC<{ buttonContent?: ReactNode; buttonClassName?:
{!connected ? (
<button
type="button"
tw="rounded-lg bg-white text-black text-xs py-3 px-5 font-semibold"
css={[
overrideContent ? undefined : tw`rounded-lg bg-white text-black text-xs py-3 px-5 font-semibold`
]}
className={className}
onClick={() => setShouldRender(true)}
>
{buttonContent || content}
{overrideContent || content}
</button>
) : (
<CurrentUserBadge onClick={disconnect} className={currentUserClassName} />
Expand Down
8 changes: 8 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ module.exports = {
'jupiter-jungle-green': '#24AE8F',
'jupiter-primary': '#FBA43A',
warning: '#FAA63C',

'v2-primary': 'rgba(199, 242, 132, 1)',
'v2-background': '#304256',
'v2-background-dark': '#19232D',
'v2-lily': '#E8F9FF',
},
transitionProperty: {
'height': 'height',
Expand All @@ -37,6 +42,9 @@ module.exports = {
animation: {
'fade-in': 'fade-in 0.5s ease-in-out',
'fade-out': 'fade-out 0.5s ease-out',
},
backgroundImage: {
'v2-text-gradient': 'linear-gradient(247.44deg, #C7F284 13.88%, #00BEF0 99.28%)',
}
},
},
Expand Down

0 comments on commit e4d1395

Please sign in to comment.