Skip to content

Commit

Permalink
rename isCursor to isBulletExpanded
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchristina committed Sep 9, 2024
1 parent ee27d30 commit 8c87af6
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/components/Bullet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const glyph = cva({
},
},
},
isCursor: { true: {} },
isBulletExpanded: { true: {} },
// childrenNew currently unused as NewThought is not importing Bullet
childrenNew: {
true: {
Expand Down Expand Up @@ -162,7 +162,7 @@ const glyph = cva({
},
{
leaf: false,
isCursor: true,
isBulletExpanded: true,
css: {
'@media (max-width: 500px)': {
_android: {
Expand All @@ -179,7 +179,7 @@ const glyph = cva({
{
leaf: false,
showContexts: true,
isCursor: true,
isBulletExpanded: true,
css: {
'@media (max-width: 500px)': {
_android: {
Expand Down Expand Up @@ -232,21 +232,21 @@ const glyphFg = cva({
true: {},
},
showContexts: { true: {} },
isCursor: { true: {} },
isBulletExpanded: { true: {} },
},
compoundVariants: [
{
leaf: false,
triangle: true,
isCursor: true,
isBulletExpanded: true,
css: {
transform: 'rotate(90deg) translateX(10px)',
},
},
{
leaf: false,
showContexts: true,
isCursor: true,
isBulletExpanded: true,
css: {
_mobile: {
left: '-0.02em',
Expand All @@ -266,14 +266,14 @@ const BulletLeaf = ({
missing,
pending,
showContexts,
isCursor,
isBulletExpanded,
}: {
fill?: string
isHighlighted?: boolean
missing?: boolean
pending?: boolean
showContexts?: boolean
isCursor?: boolean
isBulletExpanded?: boolean
} = {}) => {
const colors = useSelector(themeColors)
const radius = isIOSSafari ? 105 : 92
Expand All @@ -285,7 +285,7 @@ const BulletLeaf = ({
graypulse: pending,
showContexts,
leaf: true,
isCursor,
isBulletExpanded,
})}
data-bullet='leaf'
ry={radius}
Expand All @@ -310,15 +310,15 @@ const BulletParent = ({
childrenMissing,
pending,
showContexts,
isCursor,
isBulletExpanded,
}: {
currentScale?: number
fill?: string
isHighlighted?: boolean
childrenMissing?: boolean
pending?: boolean
showContexts?: boolean
isCursor?: boolean
isBulletExpanded?: boolean
} = {}) => {
const colors = useSelector(themeColors)
const path = isIOSSafari
Expand All @@ -340,7 +340,7 @@ const BulletParent = ({
triangle: true,
gray: childrenMissing,
graypulse: pending,
isCursor,
isBulletExpanded,
showContexts,
leaf: false,
})}
Expand Down Expand Up @@ -448,7 +448,7 @@ const Bullet = ({
})

const isExpanded = useSelector(state => !!state.expanded[hashPath(path)])
const isCursor = isCursorParent || isCursorGrandparent || isEditing || isExpanded
const isBulletExpanded = isCursorParent || isCursorGrandparent || isEditing || isExpanded

// offset margin with padding by equal amounts proportional to the font size to extend the click area
const extendClickWidth = fontSize * 1.2
Expand Down Expand Up @@ -523,7 +523,7 @@ const Bullet = ({
onClick={clickHandler}
>
<svg
className={glyph({ isCursor, showContexts, leaf })}
className={glyph({ isBulletExpanded, showContexts, leaf })}
viewBox='0 0 600 600'
style={{
// Safari has a known issue with subpixel calculations, especially during animations and with SVGs.
Expand Down Expand Up @@ -564,7 +564,7 @@ const Bullet = ({
missing={missing}
pending={pending}
showContexts={showContexts}
isCursor={isCursor}
isBulletExpanded={isBulletExpanded}
/>
) : (
<BulletParent
Expand All @@ -574,7 +574,7 @@ const Bullet = ({
childrenMissing={childrenMissing}
pending={pending}
showContexts={showContexts}
isCursor={isCursor}
isBulletExpanded={isBulletExpanded}
/>
)}
</g>
Expand Down

0 comments on commit 8c87af6

Please sign in to comment.