Skip to content

Commit f3b39b8

Browse files
committed
fix: type errors
1 parent edde0bc commit f3b39b8

File tree

2 files changed

+13
-24
lines changed

2 files changed

+13
-24
lines changed

src/entities/navigation/index.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createEvent, createStore, merge, Scope, scopeBind } from 'effector';
2-
import { createBrowserHistory } from 'history';
2+
import { createBrowserHistory, createMemoryHistory } from 'history';
33

44
import { env } from '@box/shared/config';
55

@@ -10,33 +10,31 @@ export interface HistoryChange {
1010
action: 'PUSH' | 'POP' | 'REPLACE';
1111
}
1212

13-
export const history = env.BUILD_ON_CLIENT ? createBrowserHistory() : null;
13+
export const history = env.BUILD_ON_CLIENT ? createBrowserHistory() : createMemoryHistory();
1414

1515
export const $redirectTo = createStore('');
1616

1717
// Used in some cases
1818
export const historyPush = createEvent<string>();
19-
export const historyPushParams = createEvent<{ search: string }>();
20-
export const historyReplace = createEvent<string>();
19+
// export const historyReplace = createEvent<string>();
2120

2221
export const historyChanged = createEvent<HistoryChange>();
2322

2423
export function initializeClientHistory(scope: Scope) {
2524
historyPush.watch((url) => history?.push(url));
26-
historyReplace.watch((url) => history?.replace(url));
27-
historyPushParams.watch((params) => history?.push(params));
28-
const boundHistoryChange = scopeBind(historyChanged, { scope });
29-
history?.listen(({ pathname, search, hash }, action) => {
30-
boundHistoryChange({ pathname, search, hash, action });
31-
});
25+
// historyReplace.watch((url) => history?.replace(url));
26+
// const boundHistoryChange = scopeBind(historyChanged, { scope });
27+
// history?.listen(({ pathname, search, hash }, action) => {
28+
// boundHistoryChange({ pathname, search, hash, action });
29+
// });
3230
}
3331

3432
export function initializeServerHistory() {
35-
const historyUpdate = merge([historyPush, historyReplace]);
36-
$redirectTo.on(historyUpdate, (_, url) => url);
33+
// const historyUpdate = merge([historyPush, historyReplace]);
34+
// $redirectTo.on(historyUpdate, (_, url) => url);
3735
}
3836

3937
export const navigationModel = {
4038
historyPush,
41-
historyReplace,
39+
// historyReplace,
4240
};

src/entities/user/ui/user-preview.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ const Content: React.FC<{ user: User }> = ({ user }) => {
3434
if (!user.bio) return null;
3535
return (
3636
<ContentStyled>
37-
<UserLink to={routes.user.view} params={{ username: user.username || user.id }}>
37+
<Link to={routes.user.view} params={{ username: user.username || user.id }}>
3838
<UserName type="h4" title={user.username}>
3939
<HighlightText text={user.username} />
4040
</UserName>
41-
</UserLink>
41+
</Link>
4242
<ContentText type="span">{user.bio}</ContentText>
4343
</ContentStyled>
4444
);
@@ -111,12 +111,3 @@ const ContentText = styled(Text)`
111111
display: -webkit-box;
112112
-webkit-box-orient: vertical;
113113
`;
114-
115-
const UserLink = styled(Link)`
116-
text-decoration: none;
117-
color: var(${theme.palette.bnw0});
118-
119-
&:hover {
120-
color: var(${theme.palette.wizard500});
121-
}
122-
`;

0 commit comments

Comments
 (0)