Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesigned and improved the Notifications page #1548

Open
wants to merge 23 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c344dfb
Redesigned and improved Notification page
MMDJafari Aug 24, 2022
17f4624
Update notification-body.jsx
MMDJafari Aug 24, 2022
08b25e0
Redesigned and improved Notification page
MMDJafari Aug 24, 2022
5614b8c
fix mouse hover
MMDJafari Aug 25, 2022
4888fa0
fix mouse hover
MMDJafari Aug 25, 2022
b5bca32
Update notification-body.jsx
MMDJafari Aug 25, 2022
5b03bdf
fix user tag remover
MMDJafari Aug 25, 2022
8d28281
revert back to shows mentioned users in text and parse it with peaceo…
MMDJafari Aug 26, 2022
068b90e
yarn lint
MMDJafari Aug 26, 2022
66f14c5
remove clock icon
MMDJafari Aug 26, 2022
64241c5
improve spacing between lines
MMDJafari Aug 26, 2022
2c2a89c
fix showing text & profile picture for mobile devices
MMDJafari Aug 26, 2022
f3fe2de
improve spacing between lines
MMDJafari Aug 26, 2022
b5bf47e
fix url for vercel
MMDJafari Aug 27, 2022
c42ad5f
add IG reel preview
MMDJafari Aug 27, 2022
1a4e706
revert to default config
MMDJafari Aug 27, 2022
c846deb
Play video attachments using inline video tag - using @n1313 fork
MMDJafari Aug 31, 2022
3f136f5
Revert "Play video attachments using inline video tag - using @n1313 …
MMDJafari Aug 31, 2022
b7345fb
Play video attachments using inline video tag - using @n1313 fork
MMDJafari Aug 31, 2022
ab2fe3f
add .webm & .ogg to inline video player
MMDJafari Aug 31, 2022
9934fb5
stick navigation bar to the bottom of screen
MMDJafari Sep 5, 2022
162ceda
add dark subscription request alert style
MMDJafari Sep 5, 2022
f7ef932
rebase everything
MMDJafari Dec 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const DAY_IN_MILLISECONDS = 1000 * 60 * 60 * 24;

export default {
api: {
root: 'https://candy.freefeed.net',
root: 'https://freefeed.net',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not change the default settings, they purposely specify a stage instance (candy).

For testing purposes, you can override them in the config.json file at the root of the repository. It will not be included in the commit by .gitignore.

},

siteTitle: 'FreeFeed',
Expand Down
2 changes: 2 additions & 0 deletions src/components/fontawesome-icons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
faGlobeAmericas,
faUserFriends,
faPaperclip,
faClock,
} from '@fortawesome/free-solid-svg-icons';
import { faComment, faHeart as faHeartO, faImage } from '@fortawesome/free-regular-svg-icons';
import { faCommentPlus } from './fontawesome-custom-icons';
Expand All @@ -24,6 +25,7 @@ const preloadedIcons = [
faUserFriends,
faImage,
faPaperclip,
faClock,
];

export const SVGSymbolDeclarations = memo(function SVGSymbolDeclarations() {
Expand Down
52 changes: 52 additions & 0 deletions src/components/notification-body.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { useEffect } from 'react';
import { useDispatch, useSelector} from 'react-redux';

import { getSinglePostBody, getSingleComment} from '../redux/action-creators';

/**
* @param {string} id
*/

export function getCommentBody(id) {
const dispatch = useDispatch();
useEffect(() => void dispatch(getSingleComment(id)), [dispatch, id]);
return useSelector((state) => {
return {
cmBody: state.comments[id],
ownUsername: state.user.username,
};
});
}

export function getPostBody(id) {
const dispatch = useDispatch();
useEffect(() => void dispatch(getSinglePostBody(id)), [dispatch, id]);
return useSelector((state) => {
return {
psBody: state.posts[id],
ownUsername: state.user.username,
};
});
}

export function SingleComment({id = null}) {
if (id) {
const { cmBody, ownUsername } = getCommentBody(id);
var commentBody = {};
Object.assign(commentBody, cmBody);
return <div class="post-notif"><span dir="auto" class="Linkify" role="region">{commentBody.body?.replace('@' + ownUsername, '')}</span></div>
} else {
return null
}
}

export function SinglePost({id = null}) {
if (id) {
const { psBody, ownUsername } = getPostBody(id);
var postBody = {};
Object.assign(postBody, psBody);
return <div class="post-notif"><span dir="auto" class="Linkify" role="region">{postBody.body?.replace('@' + ownUsername, '')}</span></div>
} else {
return null
}
}
Loading