From 32a2a0567ebb3f9d4949aa96aae15f2c180ade52 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Tue, 12 Nov 2019 16:14:58 +0700 Subject: [PATCH] fixed boris caption --- src/components/profile/ProfileDescription/index.tsx | 7 ++++++- src/components/profile/ProfileDescription/styles.scss | 4 ++++ src/containers/node/BorisLayout/styles.scss | 3 ++- src/redux/auth/sagas.ts | 2 +- src/redux/store.ts | 4 ++++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/components/profile/ProfileDescription/index.tsx b/src/components/profile/ProfileDescription/index.tsx index 4f633755..0fd7a816 100644 --- a/src/components/profile/ProfileDescription/index.tsx +++ b/src/components/profile/ProfileDescription/index.tsx @@ -17,7 +17,12 @@ const ProfileDescriptionUnconnected: FC = ({ profile: { user, is_loading return (
- {user.description &&
{formatText(user.description)}
} + {user.description && ( +
+ )} {!user.description && (
{user.fullname || user.username} пока ничего не рассказал о себе diff --git a/src/components/profile/ProfileDescription/styles.scss b/src/components/profile/ProfileDescription/styles.scss index df37536d..6da2db0d 100644 --- a/src/components/profile/ProfileDescription/styles.scss +++ b/src/components/profile/ProfileDescription/styles.scss @@ -1,4 +1,8 @@ .content { + padding: $gap * 2; + min-height: 200px; + display: flex; + box-sizing: border-box; } .placeholder { diff --git a/src/containers/node/BorisLayout/styles.scss b/src/containers/node/BorisLayout/styles.scss index 734d1dfb..c25fd6d4 100644 --- a/src/containers/node/BorisLayout/styles.scss +++ b/src/containers/node/BorisLayout/styles.scss @@ -116,8 +116,9 @@ line-height: 0.95em; flex-direction: column; padding-bottom: $gap * 2; - padding: 0 10% $gap * 2; + padding: 0 0 $gap * 2; transform: translate(-50%, 0); + box-sizing: border-box; @include tablet { align-items: flex-start; diff --git a/src/redux/auth/sagas.ts b/src/redux/auth/sagas.ts index 372086b3..e085647d 100644 --- a/src/redux/auth/sagas.ts +++ b/src/redux/auth/sagas.ts @@ -84,7 +84,7 @@ function* refreshUser() { function* checkUserSaga({ key }: RehydrateAction) { if (key !== 'auth') return; yield call(refreshUser); - yield put(authOpenProfile('gvorcek')); + // yield put(authOpenProfile('gvorcek')); } function* gotPostMessageSaga({ token }: ReturnType) { diff --git a/src/redux/store.ts b/src/redux/store.ts index 076721d9..1e022ea7 100644 --- a/src/redux/store.ts +++ b/src/redux/store.ts @@ -47,7 +47,11 @@ export const sagaMiddleware = createSagaMiddleware(); export const history = createBrowserHistory(); history.listen(({ pathname }) => { + console.log({ pathname }); + if (pathname.match(/~([\wа-яА-Я]+)/)) { + console.log('hi!', pathname.match(/~([\wа-яА-Я]+)/)); + const [, username] = pathname.match(/~([\wа-яА-Я]+)/); window.postMessage({ type: 'username', username }, '*'); }