Skip to content

Commit

Permalink
new creator codes layout
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeWasTakenn committed Feb 22, 2024
1 parent c7e04bc commit 753c28a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 13 deletions.
34 changes: 34 additions & 0 deletions components/CreatorCode.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from "react";
import { IconCheck, IconCopy } from '@tabler/icons-react';

interface Props {
storeName: string;
storeLink: string;
storeImage: string;
code: string;
percentOff: number;
}

const CreatorCode: React.FC<Props> = ({storeName, storeLink, storeImage, code, percentOff}) => {
const [copied, setCopied] = React.useState(false)

function copyCode() {
setCopied(true)
navigator.clipboard.writeText(code).then()
setTimeout(() => setCopied(false), 1500)
}


return <div className="flex flex-col border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-md">
<a href={storeLink} target='_blank' className="h-[150px] flex items-center justify-center bg-neutral-800 dark:hover:bg-neutral-800 hover:bg-neutral-700 dark:bg-neutral-900 rounded-none rounded-tl-lg rounded-tr-lg">
<img className="self-center" width="150" src={storeImage} alt={storeName}/>
</a>
<div className='p-2 flex items-center justify-center flex-col gap-2'>
<p className="font-bold text-lg line-clamp-1">{storeName}</p>
<p className="text-sm">Code: <code className="font-bold">{code}</code> {!copied ? <button onClick={copyCode}><IconCopy size={16}/></button> : <button><IconCheck size={16}/></button>}</p>
<p className="text-sm self-end text-red-400 font-bold mt-4">{percentOff}% off</p>
</div>
</div>
}

export default CreatorCode
8 changes: 8 additions & 0 deletions components/CreatorCodes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const CreatorCodes: React.FC<{children: React.ReactNode}> = ({children}) => {

return <div className="grid md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 grid-cols-1 mt-4 gap-4">
{children}
</div>
}

export default CreatorCodes
30 changes: 17 additions & 13 deletions pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Introduction
---

import DonateLink from '@components/DonateLink';
import CreatorCode from '@components/CreatorCode';
import CreatorCodes from '@components/CreatorCodes';

# Introduction

Expand Down Expand Up @@ -31,18 +33,20 @@ Creator codes allow Tebex stores to share a percentage of a purchase with us, wh

More information about these creators is available in our [Discord](https://discord.com/channels/813030955598086174/1028912864389496903).

| Store | Code | Discount | Link |
| ------------------------ | ------------ | -------- | ------------------------------------------------ |
| Andyyy | ox20 | 20% | https://andyyy.tebex.io/ |
| Berkie's Workshop | ox10 | 10% | https://berkie.tebex.io/ |
| Dolu Mods | overextended | 15% | https://dolu.tebex.io/ |
| Electus Scripts | ox10 | 10% | https://store.electus-scripts.com/ |
| Loaf Scripts | ox5 | 5% | https://store.loaf-scripts.com/ |
| OT Studios | ox10 | 10% | https://store.otstudios.net/ox |
| Pickle Mods | ox30 | 30% | https://store.picklemods.com/ |
| rcore | ox10 | 10% | https://store.rcore.cz/ |
| Roleplay inventory icons | ox10 | 10% | https://pixel-art-roleplay-inventory-i.tebex.io/ |
| Renewed Scripts | ox15 | 15% | https://renewed.tebex.io/ |
| Wasabi Scripts | OX20 | 20% | https://store.wasabiscripts.com/ |
<CreatorCodes>
<CreatorCode storeName="Andyyy" storeLink="https://andyyy.tebex.io/" code="ox20" percentOff={20} storeImage="https://media.discordapp.net/attachments/1119447704888672347/1119447705056460860/f4d4a06ecaad47aa93d504e99a60ba78a2735d13.png?ex=65e2896b&is=65d0146b&hm=c8bbbca1a4bac82d96212b1d603c8c9c4324e63c8b580348eee165a1a32ebb8a&"/>
<CreatorCode storeName="Berkie's Workshop" storeLink="https://berkie.tebex.io/" code="ox10" percentOff={10} storeImage="https://media.discordapp.net/attachments/1119198315259629658/1203953140983009302/d324e3485ae44f14556afd307467c9391c81e8ba.png?ex=65e56cbd&is=65d2f7bd&hm=4e37301bd50e3da0045d2edd8017bfdc723d26311d797ea7cdad5c458b044746&"/>
<CreatorCode storeName="Dolu Mods" storeLink="https://dolu.tebex.io/" code="overextended" percentOff={15} storeImage="https://media.discordapp.net/attachments/1028915320817197076/1028915321005932585/unknown.png?ex=65e56890&is=65d2f390&hm=0480551e03d4604b5e7b0ad5e012d61fe4d746843e37f0bc7af265649495f772&"/>
<CreatorCode storeName="Electus Scripts" storeLink="https://store.electus-scripts.com/" code="ox10" percentOff={10} storeImage="https://media.discordapp.net/attachments/1028916002584547348/1028916002739736628/unknown.png?ex=65e56933&is=65d2f433&hm=0d28b446a0a74eafa5fea55474c283ee127ebe67259962bdb66c9ca91a930bf2&"/>
<CreatorCode storeName="Loaf Scripts" storeLink="https://store.loaf-scripts.com/" code="ox5" percentOff={5} storeImage="https://cdn.discordapp.com/attachments/1028913316640325732/1028913316740997120/unknown.png?ex=65e566b2&is=65d2f1b2&hm=21066deeb50b621feb956b164e8a7f02637f18ee4e2b4f6f52484bacfe74fbea&"/>
<CreatorCode storeName="OT Studios" storeLink="https://store.otstudios.net/ox" code="ox10" percentOff={10} storeImage="https://media.discordapp.net/attachments/1028918682581213184/1203958621256294450/OTSDiscLogo.png?ex=65e571d7&is=65d2fcd7&hm=ce9fb2b94d1a43df3980d7284fa5829b4aacadcb056f10b4b483170ec8fb5c55&"/>

<CreatorCode storeName="Pickle Mods" storeLink="https://store.picklemods.com/" code="ox30" percentOff={30} storeImage="https://media.discordapp.net/attachments/1204592301456887818/1204593960195199016/logo.png?ex=65e7c18c&is=65d54c8c&hm=08bef6f5ab50d03317b7ad0ec9155dd21c05d7d09b7f5b98f43609ebfbf12a77&"/>
<CreatorCode storeName="rcore" storeLink="https://store.rcore.cz/" code="ox10" percentOff={10} storeImage="https://media.discordapp.net/attachments/1139497471660269578/1204037718393233488/rcore.png?ex=65e5bb82&is=65d34682&hm=7625404cc40d737e8552c614a2a3b2c02ed6e7417e0a040ba01e0fbcaa2f352d&"/>
<CreatorCode storeName="Roleplay inventory icons" storeLink="https://pixel-art-roleplay-inventory-i.tebex.io/" code="ox10" percentOff={10} storeImage="https://media.discordapp.net/attachments/1204581305430315018/1204683425932378143/artworkInventory.gif?ex=65e814de&is=65d59fde&hm=c702e55c43930c2322b78ee40eb1dcad759f34c30ea11e301c74b11a937098ac&"/>
<CreatorCode storeName="Renewed Scripts" storeLink="https://renewed.tebex.io/" code="ox15" percentOff={15} storeImage="https://media.discordapp.net/attachments/1203943581966929930/1203943582411792394/9a7d15408011ae470b767fa41a8abaced7370574.png?ex=65e563d6&is=65d2eed6&hm=05a659e8b9fbc342b419550c402c295412f26a65972999d9c1557beabeaebcc2&"/>
<CreatorCode storeName="Wasabi Scripts" storeLink="https://store.wasabiscripts.com/" code="OX20" percentOff={20} storeImage="https://media.discordapp.net/attachments/1117880517308719115/1203956014668455966/animated-avatar-updated.gif?ex=65e56f6a&is=65d2fa6a&hm=9085f4e75a135db4217792b37a0ab62b97574c58aa400f9fc5ec0186eb488733&"/>
</CreatorCodes>


You can apply a creator code at checkout under "Support A Creator".

0 comments on commit 753c28a

Please sign in to comment.