From 57ce03ff37216d9bbb41c1b3e79ea3f5e5079c46 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Fri, 10 Jul 2020 15:22:13 -0500 Subject: [PATCH] Added about routes pages to react app, layout, AboutSidebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added: - about routes pages to react app, layout, AboutSidebar - about, dmca, investors, privacy policy, terms of sale, terms of service --- .../gabsocial/components/about_sidebar.js | 77 ++++++++++ app/javascript/gabsocial/features/ui/ui.js | 17 ++- .../gabsocial/layouts/about_layout.js | 132 ++++++++++++++++++ app/javascript/gabsocial/pages/about_page.js | 26 ++++ 4 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 app/javascript/gabsocial/components/about_sidebar.js create mode 100644 app/javascript/gabsocial/layouts/about_layout.js create mode 100644 app/javascript/gabsocial/pages/about_page.js diff --git a/app/javascript/gabsocial/components/about_sidebar.js b/app/javascript/gabsocial/components/about_sidebar.js new file mode 100644 index 00000000..6bafbee0 --- /dev/null +++ b/app/javascript/gabsocial/components/about_sidebar.js @@ -0,0 +1,77 @@ +import ImmutablePropTypes from 'react-immutable-proptypes' +import ImmutablePureComponent from 'react-immutable-pure-component' +import { injectIntl, defineMessages } from 'react-intl' +import { me } from '../initial_state' +import SidebarSectionTitle from './sidebar_section_title' +import SidebarSectionItem from './sidebar_section_item' +import Heading from './heading' +import BackButton from './back_button' +import ResponsiveClassesComponent from '../features/ui/util/responsive_classes_component' + +const messages = defineMessages({ + blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' }, + mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' }, + preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' }, + menu: { id: 'menu', defaultMessage: 'Menu' }, +}) + +export default +@injectIntl +class AboutSidebar extends ImmutablePureComponent { + + static propTypes = { + intl: PropTypes.object.isRequired, + account: ImmutablePropTypes.map, + title: PropTypes.string, + items: PropTypes.array.isRequired, + } + + render() { + const { + intl, + title, + items, + } = this.props + + return ( + + + + + + + { + me && + } + + {title} + + + + + + {intl.formatMessage(messages.menu)} + { + items.map((menuItem, i) => ( + + )) + } + + + + + + + ) + } + +} \ No newline at end of file diff --git a/app/javascript/gabsocial/features/ui/ui.js b/app/javascript/gabsocial/features/ui/ui.js index c0fb09ca..51b1e637 100644 --- a/app/javascript/gabsocial/features/ui/ui.js +++ b/app/javascript/gabsocial/features/ui/ui.js @@ -38,14 +38,18 @@ import ModalPage from '../../pages/modal_page' import SettingsPage from '../../pages/settings_page' import ProPage from '../../pages/pro_page' import ExplorePage from '../../pages/explore_page' +import AboutPage from '../../pages/about_page' +import AuthPage from '../../pages/auth_page' import { + About, AccountGallery, AccountTimeline, BlockedAccounts, BlockedDomains, CommunityTimeline, Compose, + DMCA, Explore, // Filters, Followers, @@ -60,6 +64,7 @@ import { GroupTimeline, HashtagTimeline, HomeTimeline, + Investors, LikedStatuses, ListCreate, ListsDirectory, @@ -67,12 +72,15 @@ import { ListTimeline, Mutes, Notifications, + PrivacyPolicy, ProTimeline, Search, // Shortcuts, StatusFeature, StatusLikes, StatusReposts, + TermsOfSale, + TermsOfService, } from './util/async_components' import { me, meUsername } from '../../initial_state' @@ -151,7 +159,14 @@ class SwitchingArea extends PureComponent { - + + + + + + + + diff --git a/app/javascript/gabsocial/layouts/about_layout.js b/app/javascript/gabsocial/layouts/about_layout.js new file mode 100644 index 00000000..fda9ea95 --- /dev/null +++ b/app/javascript/gabsocial/layouts/about_layout.js @@ -0,0 +1,132 @@ +import { + CX, + BREAKPOINT_EXTRA_SMALL, +} from '../constants' +import { me } from '../initial_state' +import SidebarXS from '../components/sidebar_xs' +import NavigationBar from '../components/navigation_bar' +import LoggedOutNavigationBar from '../components/logged_out_navigation_bar' +import FooterBar from '../components/footer_bar' +import GlobalFooter from '../components/global_footer' +import Responsive from '../features/ui/util/responsive_component' +import ResponsiveClassesComponent from '../features/ui/util/responsive_classes_component' +import AboutSidebar from '../components/about_sidebar' + +export default class SettingsLayout extends PureComponent { + + static propTypes = { + title: PropTypes.string, + } + + componentWillMount() { + this.menuItems = [ + { + title: 'About', + to: '/about', + }, + { + title: 'Assets', + to: '/about/assets', + }, + { + title: 'DMCA', + to: '/about/dmca', + }, + { + title: 'Investors', + to: '/about/investors', + }, + { + title: 'Press', + to: '/about/press', + }, + { + title: 'Privacy Policy', + to: '/about/privacy', + }, + { + title: 'Terms of Sale', + to: '/about/sales', + }, + { + title: 'Terms of Service', + to: '/about/tos', + }, + ] + } + + render() { + const { children, title } = this.props + const { menuItems } = this + + const mainBlockClasses = CX({ + default: 1, + width1015PX: 1, + flexRow: 1, + justifyContentEnd: 1, + py15: 1, + mlAuto: !me, + mrAuto: !me, + }) + + return ( + + + + + + + { + me && + + } + { + !me && + + } + + + + + + + + + + + + + + + + + + + + {children} + + + + + + + + + + + + + + + + ) + } + +} diff --git a/app/javascript/gabsocial/pages/about_page.js b/app/javascript/gabsocial/pages/about_page.js new file mode 100644 index 00000000..72cc9aa5 --- /dev/null +++ b/app/javascript/gabsocial/pages/about_page.js @@ -0,0 +1,26 @@ +import PageTitle from '../features/ui/util/page_title' +import AboutLayout from '../layouts/about_layout' + +export default class AboutPage extends PureComponent { + + static propTypes = { + title: PropTypes.string.isRequired, + children: PropTypes.node.isRequired, + } + + render() { + const { children, title } = this.props + + return ( + + + {children} + + ) + } + +} \ No newline at end of file