[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. import React, { FC, useEffect } from 'react'
  2. import { useSelector, useDispatch } from 'react-redux'
  3. import { fetchApps } from '../../actions/apps'
  4. import { getApps } from '../../selectors/apps'
  5. import { useTheme } from '../../hooks'
  6. import { setTitle } from '../../utils'
  7. import { AppThunkDispatch } from '../../types'
  8. import Title from '../../components/title'
  9. import Section from '../../components/section'
  10. import HorizontalRule from '../../components/horizontal-rule'
  11. import AppListItem from '../../components/app-list-item'
  12. const Apps: FC = () => {
  13. const theme = useTheme()
  14. const apps = useSelector(getApps)
  15. const dispatch = useDispatch<AppThunkDispatch>()
  16. useEffect(() => {
  17. dispatch(fetchApps())
  18. setTitle('Apps')
  19. }, [])
  20. return (
  21. <div>
  22. <Section>
  23. <Title>Apps</Title>
  24. <p style={{ color: theme.text }}>Use apps to post content to Flexor.</p>
  25. <HorizontalRule />
  26. </Section>
  27. <div style={{ backgroundColor: theme.backgroundSecondary }}>
  28. {apps.map(app => <AppListItem key={app.id} app={app} />)}
  29. </div>
  30. </div>
  31. )
  32. }
  33. export default Apps