Skip to content

Commit ef79531

Browse files
authored
feat:minor refactor + meta tags (#119)
1 parent b882e29 commit ef79531

File tree

9 files changed

+49
-11
lines changed

9 files changed

+49
-11
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
"@react-native-async-storage/async-storage": "^1.15.5",
1515
"@react-native-community/slider": "^3.0.3",
1616
"@react-native-picker/picker": "^1.16.4",
17+
"@types/react-helmet": "^6.1.3",
1718
"expo": "~41.0.1",
1819
"expo-clipboard": "^1.1.0",
1920
"expo-status-bar": "~1.0.4",
2021
"react": "16.13.1",
2122
"react-dom": "16.13.1",
23+
"react-helmet": "^6.1.0",
2224
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
2325
"react-native-easing": "^1.0.1",
2426
"react-native-reanimated": "2.2.0",

src/components/AnimatedNumber.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const AnimatedNumber = ({ x }: Props) => {
5151
return <NativeText x={x} />;
5252
};
5353

54-
const s = StyleSheet.create((theme, constants) => ({
54+
const s = StyleSheet.create((theme) => ({
5555
text: {
5656
color: theme.text,
5757
textAlign: 'right',

src/components/AnimationOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { P } from '@expo/html-elements';
22
import * as React from 'react';
3-
import { View, Text, ScrollView, TouchableOpacity } from 'react-native';
3+
import { View, ScrollView, TouchableOpacity } from 'react-native';
44
import { ExampleKeyType } from 'src/constants';
55
import { StyleSheet } from 'src/styles';
66

src/components/InputSection.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ const reducer = (
3737
export const InputSection = ({
3838
onPlay,
3939
state,
40-
stopAnimation,
4140
handleChange,
4241
handleAnimationType,
4342
}: {
4443
state: StateType;
4544
onPlay: () => void;
46-
stopAnimation: () => void;
4745
handleChange: (a: Partial<ConfigType>) => void;
4846
handleAnimationType: (a: AnimationTypes) => void;
4947
}) => {
@@ -98,8 +96,7 @@ export const InputSection = ({
9896

9997
{state.animationType === 'spring' && (
10098
<WithSprings
101-
config={state.config as
102-
}
99+
config={state.config as SpringConfigType}
103100
limit={LIMIT}
104101
step={Step}
105102
handleChange={handleChange}

src/components/Movement.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const Movement = ({ x, backgroundColor }: AnimationCompProps) => {
1818
);
1919
};
2020

21-
const s = StyleSheet.create((theme, constants) => ({
21+
const s = StyleSheet.create((theme) => ({
2222
box: {
2323
height: [100, 150],
2424
width: [120, 200],

src/components/SettingModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { View, Image, Modal, Switch, Text, ScrollView } from 'react-native';
2+
import { View, Modal, Switch, Text, ScrollView } from 'react-native';
33
import { ConfigType, LimitType } from 'src/constants';
44
import { darkTheme, lightTheme, StyleSheet } from 'src/styles';
55
import { Attribution } from './Attribution';

src/constants/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export const DEFAULT_MAX_LIMIT = {
1818
mass: 5,
1919
stiffness: 300,
2020
velocity: 100,
21-
};
21+
} as const;
22+
23+
export type LimitType = typeof DEFAULT_MAX_LIMIT;
2224

2325
export const Step = {
2426
damping: 0.5,

src/screen/HomeScreen.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ import {
2121
} from 'src/constants';
2222
import { useTheme } from 'src/styles';
2323
import type { ActionTypes } from 'src/types';
24+
import { Helmet } from 'react-helmet';
2425

25-
const reducer = (state: StateType, action: ActionTypes) => {
26+
const reducer = (state: StateType, action: ActionTypes): StateType => {
2627
switch (action.type) {
2728
case 'SET_ANIMATION':
2829
return {
@@ -76,12 +77,21 @@ export const HomeScreen = () => {
7677

7778
return (
7879
<>
80+
{Platform.OS === 'web' ? (
81+
<Helmet>
82+
<title>Reanimated 2 Config Visualizer</title>
83+
<meta
84+
name="description"
85+
content="Reanimated 2 Config Visualizer works on expo and web made by mohit23x"
86+
/>
87+
</Helmet>
88+
) : null}
89+
7990
<Container>
8091
<InputSection
8192
onPlay={onPlay}
8293
state={state}
8394
handleChange={handleChange}
84-
stopAnimation={stopAnimation}
8595
handleAnimationType={handleAnimationType}
8696
/>
8797
<OutputSection x={x} stopAnimation={stopAnimation} />

yarn.lock

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,6 +1798,13 @@
17981798
dependencies:
17991799
"@types/react" "*"
18001800

1801+
"@types/react-helmet@^6.1.3":
1802+
version "6.1.3"
1803+
resolved "https://registry.yarnpkg.com/@types/react-helmet/-/react-helmet-6.1.3.tgz#1a58b26a79e464c59d3f9cdd5b7ece485335937b"
1804+
integrity sha512-U4onVxaZxAp78KpXsfmyCIhLjsvJJ3goG3CYFOo+xW0cPYAz9oe5cBAUSAcN7l35OTbrFvu9TuE0YkcZMKGr4A==
1805+
dependencies:
1806+
"@types/react" "*"
1807+
18011808
"@types/react-native@~0.64.12":
18021809
version "0.64.12"
18031810
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.64.12.tgz#1c6a3226c26d7a5949cdf8878e6cfe95fe0951d6"
@@ -5396,6 +5403,21 @@ [email protected]:
53965403
prop-types "^15.6.2"
53975404
scheduler "^0.19.1"
53985405

5406+
react-fast-compare@^3.1.1:
5407+
version "3.2.0"
5408+
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
5409+
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==
5410+
5411+
react-helmet@^6.1.0:
5412+
version "6.1.0"
5413+
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"
5414+
integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==
5415+
dependencies:
5416+
object-assign "^4.1.1"
5417+
prop-types "^15.7.2"
5418+
react-fast-compare "^3.1.1"
5419+
react-side-effect "^2.1.0"
5420+
53995421
react-is@^16.12.0, react-is@^16.8.1, react-is@^16.8.4:
54005422
version "16.13.1"
54015423
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
@@ -5498,6 +5520,11 @@ react-refresh@^0.4.0:
54985520
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.3.tgz#966f1750c191672e76e16c2efa569150cc73ab53"
54995521
integrity sha512-Hwln1VNuGl/6bVwnd0Xdn1e84gT/8T9aYNL+HAKDArLCS7LWjwr7StE30IEYbIkx0Vi3vs+coQxe+SQDbGbbpA==
55005522

5523+
react-side-effect@^2.1.0:
5524+
version "2.1.1"
5525+
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.1.tgz#66c5701c3e7560ab4822a4ee2742dee215d72eb3"
5526+
integrity sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ==
5527+
55015528
55025529
version "16.13.1"
55035530
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"

0 commit comments

Comments
 (0)