Skip to content

Commit

Permalink
Updates bullet colour to match node colour in graph (#2)
Browse files Browse the repository at this point in the history
* Updates bullet colour to match node colour in graph

* Version bump to v1.2.0

* Slightly more consistent padding
  • Loading branch information
neil-morrison44 authored Jun 9, 2022
1 parent 66d4027 commit f2e389c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "storybook-addon-recoil-flow",
"version": "1.1.0",
"version": "1.2.0",
"description": "Shows a graph of the current recoil state",
"main": "dist/preset.js",
"scripts": {
Expand Down
15 changes: 14 additions & 1 deletion src/flow/info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const RecoilNodeList = ({
gap: 10px;
overflow: auto;
margin: 0;
padding: 15px;
padding-top: 10px;
padding-bottom: 10px;
`}
Expand All @@ -26,8 +27,20 @@ const RecoilNodeList = ({
key={node.id}
css={css`
cursor: pointer;
fontsize: 1rem;
font-size: 1rem;
word-break: break-all;
display: flex;
align-items: center;
&::before {
--size: 10px;
content: "";
width: var(--size);
height: var(--size);
border-radius: var(--size);
background-color: ${node.fill};
margin-right: 15px;
}
&:hover {
text-decoration: underline;
Expand Down
10 changes: 8 additions & 2 deletions stories/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import { useRecoilValue } from "recoil"
import { useRecoilValue, useSetRecoilState } from "recoil"
import "./button.css"
import { SelectorOne, SelectorTwo } from "./testRecoilThings"
import { AtomOne, SelectorOne, SelectorTwo } from "./testRecoilThings"

interface ButtonProps {
/**
Expand Down Expand Up @@ -43,6 +43,8 @@ export const Button = ({
useRecoilValue(SelectorOne)
useRecoilValue(SelectorTwo)

const increaseHelloCount = useSetRecoilState(AtomOne)

return (
<button
type="button"
Expand All @@ -51,6 +53,10 @@ export const Button = ({
)}
style={{ backgroundColor }}
{...props}
onClick={() => {
increaseHelloCount((current) => `${current}, Hello`)
props.onClick?.()
}}
>
{label}
</button>
Expand Down

0 comments on commit f2e389c

Please sign in to comment.