Skip to content

Commit 5cbb93b

Browse files
SaraVieiraMichaelDeBoey
authored andcommitted
* moar ts * more ts * more ts * pr fixeas * Update packages/app/src/app/pages/common/Navigation/index.tsx Co-Authored-By: Michaël De Boey <[email protected]> * fix rebase * remove unsuded type * fix typecheck * Update packages/app/src/app/pages/common/SignInButton/index.tsx Co-Authored-By: Michaël De Boey <[email protected]> * Update packages/app/src/app/pages/common/UserMenu/index.tsx Co-Authored-By: Michaël De Boey <[email protected]> * Update packages/app/src/app/pages/common/UserMenu/index.tsx Co-Authored-By: Michaël De Boey <[email protected]> * pr fixes * move props * Update packages/app/src/app/pages/common/Stats/index.tsx Co-Authored-By: Michaël De Boey <[email protected]>
1 parent e2a5180 commit 5cbb93b

File tree

38 files changed

+461
-403
lines changed

38 files changed

+461
-403
lines changed
File renamed without changes.

packages/app/src/app/pages/CLI/Prompt/index.js renamed to packages/app/src/app/pages/CLI/Prompt/index.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ import { Button } from '@codesandbox/common/lib/components/Button';
66

77
import { Container, Buttons, TokenContainer } from './elements';
88

9-
const select = ({ target }) => target.select();
9+
interface Props {
10+
error: string;
11+
token: string;
12+
loading: boolean;
13+
username: string;
14+
signIn: () => void;
15+
}
1016

11-
const Prompt = ({ error, token, loading, username, signIn }) => {
17+
const select = ({ target }: { target: any }) => target.select();
18+
19+
const Prompt = ({ error, token, loading, username, signIn }: Props) => {
1220
if (error) {
1321
return (
1422
<Container>
File renamed without changes.

packages/app/src/app/pages/CliInstructions/elements.js renamed to packages/app/src/app/pages/CliInstructions/elements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const Content = styled(Centered)`
1313
margin-top: 10%;
1414
`;
1515

16-
export const Code = styled.pre`
16+
export const Code = styled.pre<{ theme: any }>`
1717
margin-bottom: 1rem;
1818
color: ${props =>
1919
props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'};
File renamed without changes.

packages/app/src/app/pages/Sandbox/Editor/Header/Action/elements.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@ import Tooltip from '@codesandbox/common/lib/components/Tooltip';
55
const blink = keyframes`
66
// @ts-ignore;
77
0% {color: ${(props: { theme: { light: boolean } }) =>
8-
props.theme.light
9-
? css`rgba(0, 0, 0, 0.7)`
10-
: css`rgba(255, 255, 255, 0.7)`}};
8+
props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}};
119
1210
50% {color: rgba(255, 255, 255, 1);}
1311
1412
100% {color: ${(props: { theme: { light: boolean } }) =>
15-
props.theme.light
16-
? css`rgba(0, 0, 0, 0.7)`
17-
: css`rgba(255, 255, 255, 0.7)`}};
13+
props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}};
1814
1915
`;
2016

packages/app/src/app/pages/Sandbox/Editor/Header/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ const LikeButton = ({
6363
style={style}
6464
text={likeCount}
6565
sandbox={store.editor.currentSandbox}
66-
store={store}
67-
signals={signals}
6866
disableTooltip
6967
highlightHover
7068
/>
@@ -284,7 +282,7 @@ const Header = ({ store, signals, zenMode }: Props) => {
284282
marginRight: 0,
285283
}}
286284
>
287-
<UserMenu store={store} signals={signals} />
285+
<UserMenu />
288286
</div>
289287
) : (
290288
<SignInButton style={{ fontSize: '.75rem' }} />

packages/app/src/app/pages/common/GithubIntegration/index.js renamed to packages/app/src/app/pages/common/GithubIntegration/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Integration from 'app/components/Integration';
66
import { useSignals, useStore } from 'app/store';
77

88
type Props = {
9-
small?: boolean,
9+
small?: boolean;
1010
};
1111
const GithubIntegration = ({ small = false }: Props) => {
1212
const { signInGithubClicked, signOutGithubIntegration } = useSignals();

packages/app/src/app/pages/common/LikeHeart/index.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import { inject, observer } from 'mobx-react';
3-
2+
import { observer } from 'mobx-react-lite';
3+
import noop from 'lodash/noop';
44
// @ts-ignore
55
import HeartIcon from '-!svg-react-loader!@codesandbox/common/lib/icons/heart-open.svg'; // eslint-disable-line import/no-webpack-loader-syntax
66
// @ts-ignore
@@ -10,6 +10,7 @@ import Tooltip from '@codesandbox/common/lib/components/Tooltip';
1010

1111
import { Container } from './elements';
1212
import { Sandbox } from '@codesandbox/common/lib/types';
13+
import { useStore, useSignals } from 'app/store';
1314

1415
const MaybeTooltip = ({ loggedIn, disableTooltip, title, children }) =>
1516
loggedIn && !disableTooltip ? (
@@ -20,8 +21,6 @@ const MaybeTooltip = ({ loggedIn, disableTooltip, title, children }) =>
2021

2122
interface Props {
2223
sandbox: Sandbox;
23-
store: any;
24-
signals: any;
2524
className?: string;
2625
colorless?: boolean;
2726
text?: string;
@@ -32,31 +31,30 @@ interface Props {
3231

3332
function LikeHeart({
3433
sandbox,
35-
store,
36-
signals,
3734
className,
3835
colorless,
3936
text,
4037
style,
4138
disableTooltip,
4239
highlightHover,
4340
}: Props) {
41+
const { isLoggedIn } = useStore();
42+
const { editor } = useSignals();
43+
4444
return (
4545
<Container
4646
style={style}
4747
hasText={text !== undefined}
48-
loggedIn={store.isLoggedIn}
48+
loggedIn={isLoggedIn}
4949
liked={sandbox.userLiked}
5050
className={className}
5151
highlightHover={highlightHover}
5252
onClick={
53-
store.isLoggedIn
54-
? () => signals.editor.likeSandboxToggled({ id: sandbox.id })
55-
: null
53+
isLoggedIn ? () => editor.likeSandboxToggled({ id: sandbox.id }) : noop
5654
}
5755
>
5856
<MaybeTooltip
59-
loggedIn={store.isLoggedIn}
57+
loggedIn={isLoggedIn}
6058
disableTooltip={disableTooltip}
6159
title={sandbox.userLiked ? 'Undo like' : 'Like'}
6260
>
@@ -72,4 +70,4 @@ function LikeHeart({
7270
);
7371
}
7472

75-
export default inject('signals', 'store')(observer(LikeHeart));
73+
export default observer(LikeHeart);

0 commit comments

Comments
 (0)