Skip to content

Commit

Permalink
Merge pull request ZecHub#81 from alurosu/main
Browse files Browse the repository at this point in the history
made wallet filter mobile friendly
  • Loading branch information
zksquirrel authored Jul 24, 2024
2 parents 55d1eae + fbc0ac3 commit 4f0995a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/wallets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function Page({ params }: { params: { slug: string } }) {
const urlRoot = `/site/using-zcash`
const roots = await getRoot(urlRoot)


const walletsParsed = parseMarkdown(content);
// console.log("Parsed Wallets:", walletsParsed); // Check parsed markdown output

Expand Down
26 changes: 20 additions & 6 deletions src/components/WalletList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ const WalletList: React.FC<Props> = ({ allWallets }) => {
const [likes, setLikes] = useState<{ [key: string]: number }>({});
const [error, setError] = useState<{ [key: string]: string }>({});
const [success, setSuccess] = useState<{ [key: string]: string }>({});
const [isFilterVisible, setIsFilterVisible] = useState(false);

const handleToggleFilter = () => {
setIsFilterVisible(!isFilterVisible);
};

useEffect(() => {
const fetchLikes = async () => {
Expand Down Expand Up @@ -157,12 +162,21 @@ const WalletList: React.FC<Props> = ({ allWallets }) => {
return (
<div className="flex flex-col md:flex-row">
<div className="wallet-filter w-auto md:w-1/5 relative">
<h2 className="text-4xl font-bold mb-6">Filters</h2>
<FilterToggle
filters={filters}
activeFilters={activeFilters}
toggleFilter={toggleFilter}
/>
<h2 className="text-4xl font-bold mb-6">
Filters
<button
onClick={handleToggleFilter}
className="float-right bg-blue-500 text-white px-4 py-2 rounded text-sm md:text-lg md:hidden">
{isFilterVisible ? 'Hide' : 'Show'}
</button>
</h2>
<div className={`md:block ${isFilterVisible ? 'block' : 'hidden'}`}>
<FilterToggle
filters={filters}
activeFilters={activeFilters}
toggleFilter={toggleFilter}
/>
</div>
</div>
<section className="h-auto w-full">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-4">
Expand Down

0 comments on commit 4f0995a

Please sign in to comment.