Skip to content

Commit

Permalink
feat: simplify typescript types
Browse files Browse the repository at this point in the history
  • Loading branch information
jpudysz committed Nov 1, 2023
1 parent 6186559 commit 571331b
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 594 deletions.
9 changes: 0 additions & 9 deletions example/.unistyles/breakpoints.d.ts

This file was deleted.

13 changes: 0 additions & 13 deletions example/.unistyles/themes.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion examples/expo/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module.exports = function (api) {
return {
presets: ['babel-preset-expo'],
plugins: [
// '../src/babel/plugin.js',
[
'module-resolver',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react'
import { View, Text, Button } from 'react-native'
import { UnistylesRuntime, createStyleSheet, useStyles } from 'react-native-unistyles'

// todo, for now TypeScript is broken
export const Cxx = () => {
const { styles, theme } = useStyles(stylesheet)

Expand All @@ -16,28 +15,28 @@ export const Cxx = () => {
Current breakpoint:
</Text>
<Text style={styles.bold}>
{` ${UnistylesRuntime.getCurrentBreakpoint()}`}
{` ${UnistylesRuntime.currentBreakpoint}`}
</Text>
</View>
<View style={styles.row}>
<Text style={styles.title}>
Theme:
</Text>
<Text style={styles.bold}>
{` ${UnistylesRuntime.getCurrentTheme()}`}
{` ${UnistylesRuntime.theme}`}
</Text>
</View>
<Button
color={theme.colors.accent}
title="Change theme"
onPress={() => {
const currentTheme = UnistylesRuntime.getCurrentTheme()
const currentTheme = UnistylesRuntime.theme
const nextTheme = currentTheme === 'light'
? 'dark'
: currentTheme === 'dark'
? 'premium'
: 'light'
UnistylesRuntime.useTheme(nextTheme)
UnistylesRuntime.setTheme(nextTheme)
}}
/>
<View style={styles.boxes}>
Expand Down
17 changes: 0 additions & 17 deletions src/UnistylesTheme.tsx

This file was deleted.

227 changes: 0 additions & 227 deletions src/babel/helpers.js

This file was deleted.

Loading

0 comments on commit 571331b

Please sign in to comment.