Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add position option #118

Merged
merged 5 commits into from
Jan 13, 2024
Merged

feat: add position option #118

merged 5 commits into from
Jan 13, 2024

Conversation

hyoban
Copy link
Contributor

@hyoban hyoban commented Jan 4, 2024

This helps us customize the style

Copy link

codesandbox-ci bot commented Jan 4, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit cf70e30:

Sandbox Source
React Configuration
React TypeScript Configuration

@arjunvegda
Copy link
Member

Hey @hyoban

Thanks for the PR! 🙌 Does overriding .jotai-devtools-trigger-button in your application not work? We expose jotai-devtools-shell too, if you'd like to add minor styles to the shell.

@hyoban
Copy link
Contributor Author

hyoban commented Jan 4, 2024

Hey @hyoban

Thanks for the PR! 🙌 Does overriding .jotai-devtools-trigger-button in your application not work? We expose jotai-devtools-shell too, if you'd like to add minor styles to the shell.

Yes, I'm using this method now, it works. But with tailwind, it will be more convenient if you can pass the classname.

@arjunvegda
Copy link
Member

Hey @hyoban
Thanks for the PR! 🙌 Does overriding .jotai-devtools-trigger-button in your application not work? We expose jotai-devtools-shell too, if you'd like to add minor styles to the shell.

Yes, I'm using this method now, it works. But with tailwind, it will be more convenient if you can pass the classname.

What sort of CSS overrides do you need? Trying to understand the use case better. We'd want to limit the customizability via new class names. Also, I am not sure if supplying the same className for Trigger and Shell is a good idea.

@hyoban
Copy link
Contributor Author

hyoban commented Jan 7, 2024

What sort of CSS overrides do you need? Trying to understand the use case better.

The main thing is the location and size. Maybe it would be more convenient to drag and zoom as we need.

We'd want to limit the customizability via new class names. Also, I am not sure if supplying the same className for Trigger and Shell is a good idea.

Yeah I just realized that. Provide two different classname?

@arjunvegda
Copy link
Member

The main thing is the location and size. Maybe it would be more convenient to drag and zoom as we need.

Got it! I think, for now, we'd want to limit overriding the class names. Could you please work with the ones that we provide out of the box instead of accepting them as props?

For the current PR, could you please update it to only include position logic? That sounds like something we'd love to support out of the box. And of course, happy to accept PRs for the drag/drop feature too.

@hyoban hyoban changed the title feat: add className and position option feat: add position option Jan 9, 2024
Comment on lines +95 to +98
left: position.includes('left') ? '0.2rem' : 'unset',
right: position.includes('right') ? '0.2rem' : 'unset',
top: position.includes('top') ? '0.2rem' : 'unset',
bottom: position.includes('bottom') ? '0.2rem' : 'unset',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some tests for this? Could be as simple as checking for these positions based on the prop

@arjunvegda
Copy link
Member

Could you also update the readme.md file with this prop?

@hyoban
Copy link
Contributor Author

hyoban commented Jan 11, 2024

@arjunvegda Updated

@arjunvegda
Copy link
Member

I'll release this shortly! Thanks again for your contribution!

@arjunvegda arjunvegda merged commit 9db1951 into jotaijs:main Jan 13, 2024
@murfidaz
Copy link

hello, when will this feature be released?

@arjunvegda
Copy link
Member

Thanks for your patience, this change has been released as part of 0.8.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants