-
-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Innei <tukon479@gmail.com>
- Loading branch information
Showing
5 changed files
with
87 additions
and
7 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
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,46 @@ | ||
import { MotionButtonBase } from '~/components/ui/button' | ||
import { FloatPopover } from '~/components/ui/float-popover' | ||
import { useIsClient } from '~/hooks/common/use-is-client' | ||
import { useConfig } from '~/hooks/data/use-config' | ||
|
||
export const DonateButton = () => { | ||
const isClient = useIsClient() | ||
const { | ||
module: { donate }, | ||
} = useConfig() | ||
if (!isClient) return null | ||
if (!donate || !donate.enable) return null | ||
|
||
return ( | ||
<FloatPopover TriggerComponent={TriggerComponent} placement="left-end"> | ||
<div className="flex flex-wrap space-x-2 center"> | ||
{donate.qrcode.map((src) => ( | ||
<img | ||
src={src} | ||
alt="donate" | ||
className="h-[300px] max-h-[70vh]" | ||
key={src} | ||
/> | ||
))} | ||
</div> | ||
</FloatPopover> | ||
) | ||
} | ||
|
||
const TriggerComponent = () => { | ||
const { | ||
module: { donate }, | ||
} = useConfig() | ||
|
||
if (!donate) return null | ||
return ( | ||
<MotionButtonBase | ||
className="flex flex-col space-y-2" | ||
onClick={() => { | ||
window.open(donate.link, '_blank') | ||
}} | ||
> | ||
<i className="icon-[material-symbols--coffee] text-[24px] opacity-80 duration-200 hover:text-uk-brown-dark hover:opacity-100" /> | ||
</MotionButtonBase> | ||
) | ||
} |
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,4 @@ | ||
import { appConfig } from '~/app.config' | ||
|
||
// TODO | ||
export const useConfig = () => appConfig |
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