From 2763b8ee6e901f4cb705c6fd18f73a00baa0d205 Mon Sep 17 00:00:00 2001 From: Aarni Halinen Date: Sun, 4 Apr 2021 22:11:24 +0300 Subject: [PATCH] add change language button on feed pages --- src/views/FeedPage/FeedPageView.tsx | 36 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/views/FeedPage/FeedPageView.tsx b/src/views/FeedPage/FeedPageView.tsx index 8629e96..925b9c0 100644 --- a/src/views/FeedPage/FeedPageView.tsx +++ b/src/views/FeedPage/FeedPageView.tsx @@ -3,7 +3,7 @@ import Image from "next/image"; import styled from "styled-components"; import colors from "@theme/colors"; import Post from "@models/Feed"; -import { TextSection } from "@components/index"; +import { TextSection, ChangeLanguageButton } from "@components/index"; import MarkdownStyles from "@views/common/MarkdownStyles"; import LoadingView from "@views/common/LoadingView"; import { useTranslation } from "../../i18n"; @@ -31,6 +31,11 @@ const Content = styled(MarkdownStyles)` margin-top: 1.5rem; `; +const LngButton = styled(ChangeLanguageButton)` + align-self: flex-end; + margin-right: 1rem; +`; + const FeedPageView: React.FC = ({ post }) => { const { i18n } = useTranslation(); if (!post) return ; @@ -45,13 +50,15 @@ const FeedPageView: React.FC = ({ post }) => { }; return ( - -

- {title} -

- {description} -

- {post.image && ( + <> + + +

+ {title} +

+ {description} +

+ {post.image && ( {title} = ({ post }) => { width={16} height={9} /> - )} -

-
- -
-
+ )} +

+
+ +
+
+ ); }; export default FeedPageView;