Skip to content

Commit

Permalink
fix: update Tile solid package, badge title type (#18)
Browse files Browse the repository at this point in the history
* fix(Badge): use correct type for title getter, use arg in container story

* fix(Title): update solid package name

* chore(withPadding): use _ for unused vars, remove extra ()
  • Loading branch information
anthony9187 authored Jul 11, 2024
1 parent 80e7b0b commit c01c800
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/solid/components/Badge/Badge.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const BadgeIcon = {
width={25}
height={25}
/>
<Text style={[styles.Text.tones[args.tone ?? styles.tone], styles.Text.base]}>Badge Text</Text>
<Text style={[styles.Text.tones[args.tone ?? styles.tone], styles.Text.base]}>{args.title}</Text>
</BadgeContainer>
);
},
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type { BadgeProps } from './Badge.types.js';
withPadding; // Preserve the import.

const getTone = (props: BadgeProps) => props.tone ?? styles.tone;
const getTitle = (title: string | string[]) => title ?? '';
const getTitle = (title: BadgeProps['title']) => title ?? '';
const getPadding = (props: BadgeProps, tone: string) =>
props.padding ?? styles.Container?.tones[tone]?.padding ?? styles.Container.base.padding;

Expand Down
2 changes: 1 addition & 1 deletion packages/solid/components/Badge/Badge.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down
2 changes: 1 addition & 1 deletion packages/solid/components/Tile/Tile.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
import type { NodeProps, NodeStyles } from '@lightningjs/solid';
import type { NodeProps, NodeStyles } from '@lightningtv/solid';
import type { ComponentStyleConfig, NodeStyleSet, Tone } from 'types/types.js';
import type { UIComponentProps } from 'types/interfaces.js';
import type { ProgressBarProps } from '../ProgressBar/ProgressBar.types.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/solid/utils/withPadding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function withPadding(el: ElementNode, padding: () => withPaddingInput) {
top = right = bottom = left = pad;
}

el.onBeforeLayout = (node, size) => {
el.onBeforeLayout = (_, size) => {
if (size) {
el.width =
el.children.reduce((acc, c) => {
Expand All @@ -69,7 +69,7 @@ export function withPadding(el: ElementNode, padding: () => withPaddingInput) {
}

let maxHeight = 0;
el.children.forEach((c) => {
el.children.forEach(c => {
c.y = top;
c.marginTop = top;
maxHeight = Math.max(maxHeight, c.height || 0);
Expand Down

0 comments on commit c01c800

Please sign in to comment.