Skip to content

Commit

Permalink
@0.2.14: Minor changes to ImageBlock
Browse files Browse the repository at this point in the history
added ElementBlock to Content Factory
added 'xxs' font size
  • Loading branch information
artemis-prime committed Feb 5, 2024
1 parent 6490f5c commit 4ad92d6
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
3 changes: 3 additions & 0 deletions pkgs/luxdefi-ui/blocks/components/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const BlockFactory: React.FC<{
case 'accordian': {
return <AccordianBlockComponent block={block} className={className} />
}
case 'element': {
return (block as B.ElementBlock).element
}
}

return <>unknown block type</>
Expand Down
22 changes: 21 additions & 1 deletion pkgs/luxdefi-ui/blocks/components/image-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,27 @@ const ImageBlockComponent: React.FC<{
const dimCon = (constraint ? constrain(dim, constraint) : dim)
toSpread.width = dimCon.w
toSpread.height = dimCon.h
}
}

// This are deprecated as props, and should be added as element styles instead.
// https://nextjs.org/docs/messages/next-image-upgrade-to-13
if (props?.objectFit) {
toSpread.style = {
objectFit: props.objectFit
}
delete props.objectFit
}
if (props?.objectPosition) {
if (toSpread.style) {
toSpread.style.objectPosition = props.objectPosition
}
else {
toSpread.style = {
objectPosition: props.objectPosition
}
}
delete props.objectPosition
}

return (props?.fill) ? (
<div className='relative w-full h-full'>
Expand Down
2 changes: 0 additions & 2 deletions pkgs/luxdefi-ui/blocks/def/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type HeadingBlock from './heading-block'
import type ImageBlock from './image-block'
import type VideoBlock from './video-block'
import type SpaceBlock from './space-block'
import type SpecialBlock from './special-block'

export {
type AccordianBlock,
Expand All @@ -21,5 +20,4 @@ export {
type ImageBlock,
type VideoBlock,
type SpaceBlock,
type SpecialBlock,
}
11 changes: 0 additions & 11 deletions pkgs/luxdefi-ui/blocks/def/special-block.ts

This file was deleted.

2 changes: 1 addition & 1 deletion pkgs/luxdefi-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@luxdefi/ui",
"version": "0.2.13",
"version": "0.2.14",
"description": "Library that contains shared UI primitives, styles, and core types",
"publishConfig": {
"registry": "https://registry.npmjs.org/",
Expand Down
1 change: 1 addition & 0 deletions pkgs/luxdefi-ui/tailwind/fonts.tailwind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const fontFamily = (ignoreTheme: any): {
}

export const fontSize = {
xxs: ['0.7rem', { lineHeight: '0.9rem' }], // very fine print
xs: ['0.8rem', { lineHeight: '1rem' }], // fine print
sm: ['0.9rem', { lineHeight: '1.2rem' }], // 'standard' some news article cards (set manually when using typography-sm)
base: ['1rem', { lineHeight: 1.4 }],
Expand Down

0 comments on commit 4ad92d6

Please sign in to comment.