MaDsEn
MaDsEn
Explore posts from servers
DDeno
Created by Dirk on 10/20/2024 in #help
Hate Preact/react for Fresh Framework
For the best answer you should ask the maintainer of fresh @marvinh.
2 replies
DDeno
Created by Thomas on 7/20/2024 in #help
Demo for Desktop App
Check out https://www.todesktop.com/. Used by companies like Linear.app
10 replies
DDeno
Created by nandi on 6/22/2024 in #help
Passing props to component from layout
What kind of data?
5 replies
DDeno
Created by rabbit_rabbit on 6/13/2024 in #help
Error upgrading headlessui
When you use the * inside the imported package it will retrieve packages that is also used in this case floating ui react, so try Importing that also with wrapping it with the alias, but without the *, but I know a lot of people have trouble with headless ui after the new version came out https://discord.com/channels/684898665143206084/991511118524715139/1240955650352349205, so some go back to a previous version for now
3 replies
DDeno
Created by wedmaniac on 2/12/2024 in #help
Problem rerender a island when updating the value of a signal!
You could check out https://github.com/lucacasonato/fresh-with-signals to see how signals could be setup and just build on it.
8 replies
DDeno
Created by wedmaniac on 2/12/2024 in #help
Problem rerender a island when updating the value of a signal!
UseState is a great way to check the code and respond is setup the right way, after that you should be able to replace it with signals.
8 replies
DDeno
Created by wedmaniac on 2/12/2024 in #help
Problem rerender a island when updating the value of a signal!
Should be possible. Try something like this - //this is the islands/SearchFilter.tsx import { useSignal } from "@preact/signals"; import { categorySignal, handleSearch } from '../signals/search.ts'; interface SearchFilterProps { initialCategory: string; } export default function SearchFilter(props: SearchFilterProps) { const [currentCategory, setCurrentCategory] = useSignal(props.initialCategory); const updateCategory = (newCategory:string) => { console.log(Updating category to: ${newCategory}); setCurrentCategory(newCategory); // Optionally, update the browser's URL to reflect the new category without reloading the page const url = new URL(window.location.toString()); url.searchParams.set('category', newCategory); // Push the new URL with the updated category window.history.pushState({}, '', url.toString()); search() }; // Helper function to determine button classes based on current category const buttonClass = (category: string) => text-xl py-1 text-white ${currentCategory() === category ? "font-bold" : "font-medium"}; return ( <div class="bg-[#242B2D] max-w-fit mx-auto "> <div>Current Category: {currentCategory()}</div> <div class ="max-w-screen-xl flex flex-row items-center justify-start mx-auto p-4"> <div class="flex flex-row items-center justify-start"> <ul class="flex gap-12"> <li> <button onClick={() => updateCategory('organizations')} class={buttonClass('organizations')}> Organizations </button> </li> ...
8 replies
DDeno
Created by wedmaniac on 2/12/2024 in #help
Problem rerender a island when updating the value of a signal!
Have you tried implementing useState - //this is the islands/SearchFilter.tsx import { useState } from 'preact/hooks'; import { categorySignal, handleSearch } from '../signals/search.ts'; interface SearchFilterProps { initialCategory: string; } export default function SearchFilter(props: SearchFilterProps) { const [currentCategory, setCurrentCategory] = useState(props.initialCategory); const updateCategory = (newCategory:string) => { console.log(Updating category to: ${newCategory}); setCurrentCategory(newCategory); // Optionally, update the browser's URL to reflect the new category without reloading the page const url = new URL(window.location.toString()); url.searchParams.set('category', newCategory); // Push the new URL with the updated category window.history.pushState({}, '', url.toString()); search() }; // Helper function to determine button classes based on current category const buttonClass = (category: string) => text-xl py-1 text-white ${currentCategory === category ? "font-bold" : "font-medium"}; return ( <div class="bg-[#242B2D] max-w-fit mx-auto "> <div>Current Category: {currentCategory}</div> <div class ="max-w-screen-xl flex flex-row items-center justify-start mx-auto p-4"> <div class="flex flex-row items-center justify-start"> <ul class="flex gap-12"> <li> <button onClick={() => updateCategory('organizations')} class={buttonClass('organizations')}> Organizations </button> </li> ...
8 replies
DDeno
Created by Ooker on 1/14/2024 in #help
How to send data from a child component to its sibling?
The concept is valid, but Fresh might need another data structure to make it work. I might take a look at it later on.
7 replies
DDeno
Created by Ooker on 1/14/2024 in #help
How to send data from a child component to its sibling?
In your Form2 component, the line <p>The value is {form1Data} + {form2Data}</p> is not joining the two values properly. Try using curly braces and the + sign outside the string to link the values. See if this works <p>The value is {form1Data + ' ' + form2Data}</p>
7 replies
DDeno
Created by HiJoe on 1/12/2024 in #help
Fresh - Page title to Layout
It looks like you're trying to dynamically populate certain elements in your layout based on route-specific data??. You might be able to achieve this using props
10 replies