Skip to content

Commit

Permalink
Merge pull request #2 from OverGamesDev/main
Browse files Browse the repository at this point in the history
add checkbox for nft
  • Loading branch information
sven-hash authored Jan 6, 2025
2 parents d72580f + dba6cba commit bb12740
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
1 change: 0 additions & 1 deletion appv2/src/app/burn/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ function BurnHistory() {
useEffect(() => {
document.body.className = '';
document.body.classList.add(theme);
document.body.classList.add("font-urbanist");
}, [theme]);

useEffect(() => {
Expand Down
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
1 change: 0 additions & 1 deletion appv2/src/app/not-found.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default function Custom404() {
useEffect(() => {
document.body.className = '';
document.body.classList.add(theme);
document.body.classList.add("font-urbanist");
}, [theme]);

return (
Expand Down
28 changes: 26 additions & 2 deletions appv2/src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getContractFactory, convertToInt, getTokenList } from "./services/utils
import { burn } from "./services/token.service";
import { useBalance } from "@alephium/web3-react";
import Image from 'next/image';
import { web3 } from '@alephium/web3';

function BurnInterface() {
const { theme, isDark } = useTheme();
Expand All @@ -22,12 +23,13 @@ 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(() => {
document.body.className = '';
document.body.classList.add(theme);
document.body.classList.add("font-urbanist");
web3.setCurrentNodeProvider(process.env.NEXT_PUBLIC_NODE_URL ?? "https://node.alphaga.app");
}, [theme]);

useEffect(() => {
Expand Down Expand Up @@ -89,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 @@ -249,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 bb12740

Please sign in to comment.