Skip to content

Commit

Permalink
add checkbox for nft
Browse files Browse the repository at this point in the history
  • Loading branch information
OverGamesDev committed Jan 6, 2025
1 parent 17a877c commit dba6cba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions appv2/src/app/context/LanguageContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const translations = {
burnSuccess: "Successfully burned",
burnError: "Error burning tokens",
connectWalletToBurn: "Connect wallet to burn tokens",
receiveNFT: "Receive NFT for this burn",
},
fr: {
// Navbar
Expand Down Expand Up @@ -101,6 +102,7 @@ export const translations = {
burnSuccess: "Tokens brûlés avec succès",
burnError: "Erreur lors de la destruction",
connectWalletToBurn: "Connectez votre wallet pour brûler des tokens",
receiveNFT: "Recevoir un NFT pour ce burn",
}
};

Expand Down
25 changes: 24 additions & 1 deletion appv2/src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function BurnInterface() {
const [isLoading, setIsLoading] = useState(true);
const [rawAmount, setRawAmount] = useState();
const [isCustomToken, setIsCustomToken] = useState(false);
const [wantNFT, setWantNFT] = useState(false);
const [burnSummary, setBurnSummary] = useState(null);

useEffect(() => {
Expand Down Expand Up @@ -90,7 +91,7 @@ function BurnInterface() {
Number(floatToDecimals[1]),
selectedToken?.id ?? '',
selectedToken?.decimals ?? 0,
false,
wantNFT,
account?.group,
rawAmount != undefined? true : false
);
Expand Down Expand Up @@ -250,6 +251,28 @@ function BurnInterface() {
</div>
</div>

<div className="flex items-center gap-2">
<input
type="checkbox"
id="wantNFT"
checked={wantNFT}
onChange={(e) => setWantNFT(e.target.checked)}
className={`w-4 h-4 rounded transition-colors duration-200 ${
isDark
? 'bg-gray-700 border-gray-600'
: 'bg-gray-50 border-gray-200'
} border focus:ring-2 focus:ring-orange-400`}
/>
<label
htmlFor="wantNFT"
className={`text-sm transition-colors duration-200 ${
isDark ? 'text-gray-300' : 'text-gray-700'
}`}
>
{t('receiveNFT') || 'Receive NFT for this burn'}
</label>
</div>

<motion.button
whileHover={{ scale: 1.02 }}
whileTap={{ scale: 0.98 }}
Expand Down

0 comments on commit dba6cba

Please sign in to comment.