Comments (3)
Maybe I'll have to do both.
- People will probably want to do other things that require reading/changing state. I imagine that adding
onTabChange
,activeTab
props would probably do it. - I'm trying to strike the balance between having Earthbar be flexible and having it be useful out the box. Being able to click outside of the box to close a tab seems like a pretty common request. I need to think a bit harder about this...
from react-earthstar.
Because the Earthbar's presentation is meant to be determined by the app using it (it could be horizontal, vertical, tabs, a drawer…) I think doing this in Twodays Crossing might be the right place actually. Baking into this library would be making too much of an assumption, imo.
from react-earthstar.
@sgwilym I can't find a way to do this from outside of react-earthstar.
My goal was to make a giant div that would cover the entire screen, sitting just behind the tab panel, with an onClick event that closes the tab. I ran into some difficulties:
- I think the app doesn't have the ability read or change the Earthbar's tab state from the outside?
- It can't know when to draw the giant div itself
- It can't close the tab
- I tried adding the giant div as a
::before
pseudo-element on the actual Earthbar tab using just CSS.- Turns out pseudo-elements can't have onClick handlers
Ways for React-earthstar to help
- Render a div that, when clicked, closes a tab. It could be hidden by default and apps can override the CSS to make it into a screen-covering giant div like I was trying to make
- Or somehow expose the tab state to the app so it can be read and changed. I'm not sure how, since the Earthbar and the app are siblings in the tree.
from react-earthstar.
Related Issues (20)
- Add styling guide
- Actually delete workspaces when they are removed
- Add UI for live syncing HOT 1
- Author a few default Earthbar themes HOT 1
- Create an onboarding tab HOT 1
- Create component for redeeming + creating Earthstar invitations
- Invite code has "undefined" as workspace
- Maybe only sync the active workspace?
- Add a pronouns.json in /about with Earthbar UI
- Variety of small CSS issues
- add button works when pub field is blank
- Current workspace is only remembered if you're logged in as a user
- Can't remove the last workspace HOT 1
- Recursive duplication of Storage data in localStorage HOT 6
- Slowness when more than 1 workspace is set up HOT 3
- useDocuments(query) doesn't always update on deletions, because of paths() query limits HOT 2
- FocusSyncer is triggered multiple times at once when switching back to a tab HOT 3
- Storages are `close()`d in unneeded situations HOT 1
- The path to React 18 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-earthstar.