diff --git a/app/soapbox/actions/accounts.js b/app/soapbox/actions/accounts.js index 23aad5601b..1005af8380 100644 Binary files a/app/soapbox/actions/accounts.js and b/app/soapbox/actions/accounts.js differ diff --git a/app/soapbox/components/account.tsx b/app/soapbox/components/account.tsx index ab9c7af68d..ccdc10578a 100644 --- a/app/soapbox/components/account.tsx +++ b/app/soapbox/components/account.tsx @@ -175,7 +175,7 @@ const Account = ({ @{username} {favicon && ( - + )} diff --git a/app/soapbox/components/birthday-panel.tsx b/app/soapbox/components/birthday-panel.tsx new file mode 100644 index 0000000000..6008cb423e --- /dev/null +++ b/app/soapbox/components/birthday-panel.tsx @@ -0,0 +1,47 @@ +import { OrderedSet as ImmutableOrderedSet } from 'immutable'; +import * as React from 'react'; +import { FormattedMessage } from 'react-intl'; +import { useDispatch } from 'react-redux'; + +import { fetchBirthdayReminders } from 'soapbox/actions/accounts'; +import { Widget } from 'soapbox/components/ui'; +import AccountContainer from 'soapbox/containers/account_container'; +import { useAppSelector } from 'soapbox/hooks'; + +interface IBirthdayPanel { + limit: number +} + +const BirthdayPanel = ({ limit }: IBirthdayPanel) => { + const dispatch = useDispatch(); + + const birthdays: ImmutableOrderedSet = useAppSelector(state => state.user_lists.getIn(['birthday_reminders', state.me], ImmutableOrderedSet())); + const birthdaysToRender = birthdays.slice(0, limit); + + React.useEffect(() => { + const date = new Date(); + + const day = date.getDate(); + const month = date.getMonth() + 1; + + dispatch(fetchBirthdayReminders(month, day)); + }, []); + + if (birthdaysToRender.isEmpty()) { + return null; + } + + return ( + }> + {birthdaysToRender.map(accountId => ( + , but it isn't + id={accountId} + /> + ))} + + ); +}; + +export default BirthdayPanel; diff --git a/app/soapbox/components/birthday_reminders.js b/app/soapbox/components/birthday_reminders.js index d57452150a..aa50a2fec6 100644 Binary files a/app/soapbox/components/birthday_reminders.js and b/app/soapbox/components/birthday_reminders.js differ diff --git a/app/soapbox/features/edit_profile/index.js b/app/soapbox/features/edit_profile/index.js index b683e8f199..fe0c668826 100644 Binary files a/app/soapbox/features/edit_profile/index.js and b/app/soapbox/features/edit_profile/index.js differ diff --git a/app/soapbox/features/ui/util/async-components.js b/app/soapbox/features/ui/util/async-components.js index 9f031adbc8..17f54d3f4b 100644 Binary files a/app/soapbox/features/ui/util/async-components.js and b/app/soapbox/features/ui/util/async-components.js differ diff --git a/app/soapbox/pages/home_page.js b/app/soapbox/pages/home_page.js index e8a12a5d8c..e9b6630aa1 100644 Binary files a/app/soapbox/pages/home_page.js and b/app/soapbox/pages/home_page.js differ