diff --git a/package.json b/package.json index 284fb692..77d7145c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "d.buzz-client", "homepage": ".", - "version": "3.45.0", + "version": "3.46.0", "private": true, "dependencies": { "3id-blockchain-utils": "^1.3.1", @@ -163,4 +163,4 @@ "browser": { "process": "process/browser.js" } -} +} \ No newline at end of file diff --git a/public/widgets/buzzWidget.js b/public/widgets/buzzWidget.js index ac139a61..b65fc685 100644 --- a/public/widgets/buzzWidget.js +++ b/public/widgets/buzzWidget.js @@ -179,4 +179,4 @@ __dbuzzwidget.i(); } }; -})); +})); \ No newline at end of file diff --git a/public/widgets/buzz_button.html b/public/widgets/buzz_button.html index d34e8525..f36a327b 100644 --- a/public/widgets/buzz_button.html +++ b/public/widgets/buzz_button.html @@ -26,4 +26,4 @@ const buzzButton=new BuzzButton();buzzButton.i()}) - + \ No newline at end of file diff --git a/src/App.js b/src/App.js index d37d3b4b..141dea8a 100644 --- a/src/App.js +++ b/src/App.js @@ -36,6 +36,17 @@ const App = () => { redirectOldLinks() }, []) + if(window.location.host !== 'd.buzz'){ + const passwordWall = localStorage.getItem('passwordWall') + if(passwordWall !== "dbuzz"){ + let passwordW = null + while(passwordW == null || passwordW !== "dbuzz"){ + passwordW = prompt("The password is dbuzz (all lower-case).") + } + localStorage.setItem('passwordWall', passwordW) + } + } + return ( }> diff --git a/src/components/common/HelmetGenerator/index.js b/src/components/common/HelmetGenerator/index.js index 8151acbe..d14b3c1e 100644 --- a/src/components/common/HelmetGenerator/index.js +++ b/src/components/common/HelmetGenerator/index.js @@ -1,14 +1,12 @@ import React, { useState, useEffect } from 'react' import { Helmet } from 'react-helmet' -import { checkIfImage } from 'services/api' import removeMd from 'remove-markdown' -import { parseUrls, stripHtml } from 'services/helper' +import { stripHtml } from 'services/helper' const HelmetGenerator = (props) => { const {content, user, page = 'content'} = props const [title, setTitle] = useState() const [description, setDescription] = useState() - const [image, setImage] = useState() const url = window.location.href useEffect(() => { @@ -18,7 +16,6 @@ const HelmetGenerator = (props) => { const stripContent = stripHtml(removeMd(content)) let title = stripContent let description = stripContent - const links = parseUrls(content) if(`${title}`.length > 80) { title = `${title.substr(0, 80)} ...` @@ -31,22 +28,10 @@ const HelmetGenerator = (props) => { } description = `${description} | by ${user}` - const avatarLink = `https://images.hive.blog/u/${user}/avatar/large` setTitle(title) setDescription(description) - if(links.length !== 0) { - const result = await checkIfImage(links) - const { hasImage, imageUrl } = result - if(hasImage) { - setImage(`https://images.hive.blog/0x0/${imageUrl}`) - } else { - setImage(avatarLink) - } - } else { - setImage(avatarLink) - } window.prerenderReady = true } @@ -65,16 +50,22 @@ const HelmetGenerator = (props) => { {title} - + + + - + + + - + + + )} {page !== 'content' && ( diff --git a/src/components/common/ImageCropper/index.js b/src/components/common/ImageCropper/index.js index 821f6ed4..300a361c 100644 --- a/src/components/common/ImageCropper/index.js +++ b/src/components/common/ImageCropper/index.js @@ -62,11 +62,11 @@ const useStyles = createUseStyles(theme => ({ background: '#F5F8FA', marginRight: 8, color: '#000000 !important', - + '&:hover': { background: '#EDF0F2', }, - + '&:active': { background: '#EDF0F2 !important', }, @@ -79,7 +79,7 @@ const useStyles = createUseStyles(theme => ({ }, })) -const ImageCropper = ({ isOpen, onClose, src, onCropComplete }) => { +const ImageCropper = ({ isOpen, onClose, src, onCropComplete, username }) => { const classes = useStyles() const [cropData, setCropData] = useState("#") const cropperRef = useRef(null) @@ -90,7 +90,7 @@ const ImageCropper = ({ isOpen, onClose, src, onCropComplete }) => { const croppedImage = cropper.getCroppedCanvas().toDataURL() setCropData(croppedImage) if (onCropComplete) { - onCropComplete(croppedImage) + onCropComplete(croppedImage ,username) } console.log(cropData) } else { diff --git a/src/components/common/MoreMenu/index.js b/src/components/common/MoreMenu/index.js index 674da46f..f5ecfe88 100644 --- a/src/components/common/MoreMenu/index.js +++ b/src/components/common/MoreMenu/index.js @@ -1,6 +1,13 @@ import React, { useState, useEffect } from 'react' import Menu from '@material-ui/core/Menu' -import MenuItem from '@material-ui/core/MenuItem' +import ListSubheader from '@material-ui/core/ListSubheader' +import List from '@material-ui/core/List' +import ListItem from '@material-ui/core/ListItem' +import ListItemText from '@material-ui/core/ListItemText' +import Collapse from '@material-ui/core/Collapse' +import ExpandLess from '@material-ui/icons/ExpandLess' +import ExpandMore from '@material-ui/icons/ExpandMore' +import Divider from '@material-ui/core/Divider' const MoreMenu = (props) => { const { @@ -24,7 +31,11 @@ const MoreMenu = (props) => { setcallFunc(onClick) setOverflow('scroll') } - + + const handleClickCollapse = (onClick) => () => { + setcallFunc(onClick) + } + useEffect(() => { // console.log(open, themeModal, switchUserModal) setcallFunc(callFunc) @@ -36,7 +47,6 @@ const MoreMenu = (props) => { } // eslint-disable-next-line }, [open, themeModal, switchUserModal]) - return ( { open={open} onClose={onClose} className={className} - transformOrigin={{vertical: 'bottom', horizontal: 'top'}} + transformOrigin={{vertical: 'top', horizontal: 'top'}} > - {items.map(({onClick, text, visible}) => ( - visible && {text} - ))} + + Advanced + } + style={{ + maxHeight: '400px', // Adjust this value based on your needs + overflowY: 'auto', // This makes the list scrollable + }} + > + + {items.map(({onClick, text, visible, subItems, collapse}) => ( + visible && + ( + Object.keys(subItems).length > 0 ? ( + <> + + {/* + + */} + + {collapse ? : } + + + {subItems.map(({subonClick, subtext, subhref}) => ( + subhref === '' ? + + + {/* + + */} + + + + : + + + {/* + + */} + + + + + ))} + + + ) + : + + {/* + + */} + + + ) + ))} + ) } diff --git a/src/components/common/UserDialog/index.js b/src/components/common/UserDialog/index.js index a2f47158..55d40096 100644 --- a/src/components/common/UserDialog/index.js +++ b/src/components/common/UserDialog/index.js @@ -107,8 +107,8 @@ const UserDialog = React.memo((props) => { const [author, setAuthor] = useState('') const { username, is_authenticated } = user const [shouldStayOpen, setShouldStayOpen] = useState(false) - const [hasRecentlyFollowed, setHasRecentlyFollowed] = useState(false) - const [hasRecentlyUnfollowed, setHasRecentlyUnfollowed] = useState(false) + const [setHasRecentlyFollowed] = useState(false) + const [setHasRecentlyUnfollowed] = useState(false) const [followerCount, setFollowerCount] = useState(0) const [followingCount, setFollowingCount] = useState(0) const [isFollowed, setIsFollowed] = useState(false) @@ -214,6 +214,7 @@ const UserDialog = React.memo((props) => { broadcastNotification('success', `Successfully followed @${author}`) setHasRecentlyFollowed(true) setHasRecentlyUnfollowed(false) + setIsFollowed(true) } else { broadcastNotification('error', `Failed following @${author}`) } @@ -228,6 +229,7 @@ const UserDialog = React.memo((props) => { broadcastNotification('success', `Successfully Unfollowed @${author}`) setHasRecentlyFollowed(false) setHasRecentlyUnfollowed(true) + setIsFollowed(false) } else { broadcastNotification('error', `Failed Unfollowing @${author}`) } @@ -276,7 +278,7 @@ const UserDialog = React.memo((props) => {
{is_authenticated && ( - {((!isFollowed && !hasRecentlyFollowed) || hasRecentlyUnfollowed) && (username !== author) && ( + {!isFollowed && (username !== author) && ( { onClick={followUser} /> )} - {((isFollowed || hasRecentlyFollowed) && !hasRecentlyUnfollowed) && (username !== author) && ( + {isFollowed && (username !== author) && ( { +const BookmarkIcon = ({ height = 20, top = 0, type }) => { + // return ( + // + // + // + // + // + // ) return ( - - - - - + type === 'outline' ? + + + + : + + + + ) } diff --git a/src/components/elements/Icons/CommunityIcon/index.js b/src/components/elements/Icons/CommunityIcon/index.js new file mode 100644 index 00000000..c4560ab8 --- /dev/null +++ b/src/components/elements/Icons/CommunityIcon/index.js @@ -0,0 +1,15 @@ +import React from 'react' + +const CommunityIcon = ({ height = 20, top = 0, type }) => { + return ( + type === 'outline' ? + + + : + + + + ) +} + +export default CommunityIcon diff --git a/src/components/layout/GuardedAppFrame/index.js b/src/components/layout/GuardedAppFrame/index.js index 400b703e..4bb25c94 100644 --- a/src/components/layout/GuardedAppFrame/index.js +++ b/src/components/layout/GuardedAppFrame/index.js @@ -19,9 +19,11 @@ import { bindActionCreators } from 'redux' import { useLastLocation } from 'react-router-last-location' import { useWindowDimensions } from 'services/helper' import { pending } from 'redux-saga-thunk' -import { SideBarLeft, SideBarRight, SearchField, NotificationFilter } from 'components' +import { SideBarLeft, SideBarRight, SearchField } from 'components' import BuzzFormModal from 'components/modals/BuzzFormModal' import { Fab } from '@material-ui/core' +import { getTheme } from 'services/theme' +import { getUserTheme } from 'services/helper' // import BuzzIcon from 'components/elements/Icons/BuzzIcon' import CreateBuzzIcon from 'components/elements/Icons/CreateBuzzIcon' @@ -90,7 +92,10 @@ const floatStyle = { left: 'auto', position: 'fixed', zIndex: 500, - backgroundColor: '#e61c34', + border: `${getTheme(getUserTheme())?.buzzButton?.border}`, + color: `${getTheme(getUserTheme())?.buzzButton?.color}`, + backgroundColor: `${getTheme(getUserTheme())?.background?.primary}`, + fill: `${getTheme(getUserTheme())?.buzzButton?.fill}`, } const GuardedAppFrame = (props) => { @@ -287,7 +292,7 @@ const GuardedAppFrame = (props) => { )} {title !== 'Search' && ({title})} - {title === 'Notifications' && } + {/*{title === 'Notifications' && }*/} {title === 'Search' && (
@@ -326,7 +331,7 @@ const GuardedAppFrame = (props) => { {renderRoutes(route.routes)} {minify && ( - + )} diff --git a/src/components/layout/MobileAppFrame/index.js b/src/components/layout/MobileAppFrame/index.js index 94bfefe0..c20068f6 100644 --- a/src/components/layout/MobileAppFrame/index.js +++ b/src/components/layout/MobileAppFrame/index.js @@ -1,4 +1,4 @@ -import React, { useEffect, useState, useRef } from 'react' +import React, { useEffect, useState } from 'react' import Navbar from 'react-bootstrap/Navbar' import { useHistory } from 'react-router-dom' import { renderRoutes } from 'react-router-config' @@ -10,6 +10,12 @@ import { useLastLocation } from 'react-router-last-location' import { connect } from 'react-redux' import { Link } from 'react-router-dom' import { pollNotifRequest } from 'store/polling/actions' +import List from '@material-ui/core/List' +import ListItem from '@material-ui/core/ListItem' +import ListItemText from '@material-ui/core/ListItemText' +import Collapse from '@material-ui/core/Collapse' +import ExpandLess from '@material-ui/icons/ExpandLess' +import ExpandMore from '@material-ui/icons/ExpandMore' import { BackArrowIcon, HomeIcon, @@ -21,11 +27,12 @@ import { Avatar, // BuzzIcon, // AccordionArrowDownIcon, - SettingsIcon, + // SettingsIcon, SearchIcon, - PocketIcon, + // PocketIcon, MessageIcon, - WalletIcon, + BookmarkIcon, + // WalletIcon, } from 'components/elements' import { BuzzFormModal, @@ -33,8 +40,6 @@ import { SwitchUserModal, LoginModal, SearchField, - NotificationFilter, - MoreMenu, } from 'components' import { useLocation } from 'react-router-dom' import Fab from '@material-ui/core/Fab' @@ -46,7 +51,7 @@ import { bindActionCreators } from 'redux' import { broadcastNotification, setRefreshRouteStatus } from 'store/interface/actions' import { signoutUserRequest, setIntentBuzz } from 'store/auth/actions' import { searchRequest, clearSearchPosts } from 'store/posts/actions' -import { getUserCustomData, updateUserCustomData } from 'services/database/api' +// import { getUserCustomData, updateUserCustomData } from 'services/database/api' import { pending } from 'redux-saga-thunk' import queryString from 'query-string' @@ -54,14 +59,15 @@ import moment from 'moment' import SettingsModal from 'components/modals/SettingsModal' import CreateBuzzIcon from 'components/elements/Icons/CreateBuzzIcon' // import MoreIcon from 'components/elements/Icons/MoreIcon' -import { checkCeramicLogin, checkForCeramicAccount } from 'services/ceramic' +import { checkCeramicLogin } from 'services/ceramic' import { generateStyles } from 'store/settings/actions' import { getTheme } from 'services/theme' import { getUserTheme } from 'services/helper' import { Image } from 'react-bootstrap' import ProfileIcon from 'components/elements/Icons/ProfileIcon' -import MoonIcon from 'components/elements/Icons/MoonIcon' -import SunIcon from 'components/elements/Icons/SunIcon' +// import MoonIcon from 'components/elements/Icons/MoonIcon' +// import SunIcon from 'components/elements/Icons/SunIcon' +import CommunityIcon from 'components/elements/Icons/CommunityIcon' // import MoreIcon from 'components/elements/Icons/MoreIcon' const useStyles = createUseStyles(theme => ({ @@ -220,6 +226,7 @@ const useStyles = createUseStyles(theme => ({ display: 'flex', }, navBottom: { + paddingBottom: 25, borderTop: theme.border.primary, backgroundColor: theme.background.primary, zIndex: 2, @@ -386,6 +393,21 @@ const useStyles = createUseStyles(theme => ({ }, '& ul':{ background: theme.background.primary, + '& nav':{ + background: theme.background.primary, + '& div':{ + fontSize: 18, + fontWeight: '500 !important', + background: theme.background.primary, + color: theme.font.color, + '& div':{ + '& div':{ + paddingLeft: '5%', + }, + }, + }, + }, + }, '& li': { fontSize: 18, @@ -396,9 +418,69 @@ const useStyles = createUseStyles(theme => ({ '&:hover': { ...theme.context.view, }, + + '#advanced-subheader': { + // Your specific styles for the id="advanced-subheader" + color: 'red', + fontWeight: 'bold', + }, }, - '& a': { - color: theme.font.color, + }, + nestedList: { + whiteSpace: 'nowrap', + overflow: 'hidden', + textOverflow: 'ellipsis', + fontSize: 18, + fontWeight: 'normal !important', + background: theme.background.secondary, + color: theme.font.color, + '&:hover': { + ...theme.context.view, + }, + '& div':{ + '& div':{ + '& div':{ + paddingLeft: '5%', + // paddingTop: '4px', + // paddingBottom: '4px', + '& a':{ + paddingTop: '0px', + paddingBottom: '0px', + paddingLeft: '5%', + '& div':{ + marginTop: '0px', + marginBottom: '0px', + }, + }, + '& div':{ + paddingTop: '4px', + paddingBottom: '4px', + paddingLeft: '5%', + '& div':{ + marginTop: '0px', + marginBottom: '0px', + }, + }, + }, + }, + }, + '& ul':{ + paddingTop: '0px', + paddingBottom: '0px', + '& div':{ + '& div':{ + '& span':{ + fontWeight: 'normal !important', + }, + }, + }, + '& a':{ + '& div':{ + '& span':{ + fontWeight: 'normal !important', + }, + }, + }, }, }, moreButton: { @@ -513,42 +595,42 @@ const MobileAppFrame = (props) => { setRefreshRouteStatus, generateStyles, } = props - const customUserData = JSON.parse(localStorage.getItem('customUserData')) - const THEME = { - LIGHT: 'light', - NIGHT: 'night', - } - const handleClickSetTheme = (mode) => () => { - const data = { ...customUserData, settings: { ...customUserData?.settings, theme: mode } } - localStorage.setItem('customUserData', JSON.stringify({...data})) - const theme = getTheme(mode) - generateStyles(theme) - handleUpdateTheme(mode) - } - - const handleUpdateTheme = (theme) => { - const { username } = user - - getUserCustomData(username) - .then(res => { - const userData = { - ...res[0], - settings: { - ...res[0].settings, - theme: theme, - }, - } - const responseData = { username, userData: [userData] } - - if(res) { - updateUserCustomData(responseData) - .then(() => { - // setLoading(false) - }) - } - }) - - } + // const customUserData = JSON.parse(localStorage.getItem('customUserData')) + // const THEME = { + // LIGHT: 'light', + // NIGHT: 'night', + // } + // const handleClickSetTheme = (mode) => () => { + // const data = { ...customUserData, settings: { ...customUserData?.settings, theme: mode } } + // localStorage.setItem('customUserData', JSON.stringify({...data})) + // const theme = getTheme(mode) + // generateStyles(theme) + // handleUpdateTheme(mode) + // } + + // const handleUpdateTheme = (theme) => { + // const { username } = user + + // getUserCustomData(username) + // .then(res => { + // const userData = { + // ...res[0], + // settings: { + // ...res[0].settings, + // theme: theme, + // }, + // } + // const responseData = { username, userData: [userData] } + + // if(res) { + // updateUserCustomData(responseData) + // .then(() => { + // // setLoading(false) + // }) + // } + // }) + + // } const mode = getUserTheme() @@ -570,12 +652,14 @@ const MobileAppFrame = (props) => { const [disableSearchTips, setDisableSearchTips] = useState(false) const query = params.q === undefined ? '' : params.q const [searchkey, setSearchkey] = useState(query) - const [openMoreMenu, setOpenMoreMenu] = useState(false) + // const [openMoreMenu, setOpenMoreMenu] = useState(false) // const [showSettings, setShowSettings] = useState(false) - const moreMenuRef = useRef() + // const moreMenuRef = useRef() const classes = useStyles() const [activeView, setActiveView] = useState('trending') + const [showProfessionalTools, setShowProfessionalTools] = useState(false) + const [showSettingsAndSupport, setShowSettingsAndSupport] = useState(false) let title = 'Trending' let openedSubProfile = false @@ -600,6 +684,10 @@ const MobileAppFrame = (props) => { title = 'Latest' } + if (pathname.match(/^\/messages/)) { + title = 'Messages' + } + if (!pathname.match(/(\/c\/)/) && pathname.match(/^\/@/)) { title = 'Profile' } @@ -650,16 +738,16 @@ const MobileAppFrame = (props) => { } } - const handleClickOpenMoreMenu = () => { - setOpenMoreMenu(true) - } + // const handleClickOpenMoreMenu = () => { + // setOpenMoreMenu(true) + // } - const redirectToChatPage = () => { - window.location.href = "https://chat.d.buzz" - } + // const handleClickCloseOpenMoreMenu = () => { + // setOpenMoreMenu(false) + // } - const handleClickCloseOpenMoreMenu = () => { - setOpenMoreMenu(false) + const redirectToChatPage = () => { + window.open("https://chat.d.buzz/") } const floatStyle = { @@ -707,12 +795,15 @@ const MobileAppFrame = (props) => { case 'Trending': refreshTrendingRouteData() break + case 'messages': + redirectToChatPage() + break // case 'Latest': // refreshLatestRouteData() // break - case 'More': - handleClickOpenMoreMenu() - break + // case 'More': + // handleClickOpenMoreMenu() + // break default: return } @@ -739,8 +830,8 @@ const MobileAppFrame = (props) => { case '/latest': setActiveView('latest') break - case '/message': - setActiveView('message') + case '/messages': + setActiveView('messages') break case '/notifications': setActiveView('notifications') @@ -758,7 +849,7 @@ const MobileAppFrame = (props) => { return } // eslint-disable-next-line - }, []) + }, [location]) const NavLinks = [ { @@ -808,9 +899,11 @@ const MobileAppFrame = (props) => { // onClick: () => handelClickItem('wallet'), // }, { - name: 'Message', - icon: activeView === 'message' ? : , - onClick:() => redirectToChatPage(), + name: 'Messages', + icon: activeView === 'messages' ? : , + path: `#`, + preventDefault: false, + onClick: () => handelClickItem('messages'), }, // { // name: 'More' , @@ -841,7 +934,7 @@ const MobileAppFrame = (props) => { name: 'Message', icon: activeView === 'message' ? : , path: `/message`, - onClick: () => handelClickItem('message'), + onClick:() => handelClickItem('messages'), }, // { // name: 'Trending', @@ -914,10 +1007,10 @@ const MobileAppFrame = (props) => { setOpenSwitchModal(true) } - const showSettingsModal = () => { - handleClickCloseOpenMoreMenu() - setOpenSettingsModal(true) - } + // const showSettingsModal = () => { + // handleClickCloseOpenMoreMenu() + // setOpenSettingsModal(true) + // } const onHideSwitchModal = () => { setOpenSwitchModal(false) @@ -940,6 +1033,23 @@ const MobileAppFrame = (props) => { window.open('https://discord.gg/kCZGPs7', '_blank') } + // const handelClickWallet = () => { + // history.push(`/@${username}/wallet/balances`) + // handelClickItem('wallet') + // } + + const toggleProfessionTools = () => { + setShowProfessionalTools(!showProfessionalTools) + } + + const toggleSettingsAndSupport = () => { + setShowSettingsAndSupport(!showSettingsAndSupport) + } + + const showComingSoon = () => { + broadcastNotification('success', `Coming soon`) + } + const { stats, metadata } = profile || '' const {profile: profileMeta} = metadata || '' const {name:userName} = profileMeta || '' @@ -965,7 +1075,7 @@ const MobileAppFrame = (props) => { const NavLinkWrapper = ({ item, active }) => { return (
- + { } } - const showNotificationForMessage = () => { - broadcastNotification('success', 'Coming soon') - } // eslint-disable-next-line useEffect(() => { if (is_authenticated) { @@ -1058,6 +1165,11 @@ const MobileAppFrame = (props) => { // eslint-disable-next-line const [showSideBarNavigation, setShowSideBarNavigation] = useState(false) + const handleRedirectToWallet = () => { + setShowSideBarNavigation(false) + history.push(`/@${username}/wallet`) + } + return ( @@ -1078,18 +1190,18 @@ const MobileAppFrame = (props) => {
- {userName || username} + {userName || username} - @{username} + @{username}
-
{following} Following
-
{followers} Followers
+
{following} Following
+
{followers} Followers
@@ -1098,7 +1210,7 @@ const MobileAppFrame = (props) => { setShowSideBarNavigation(false)} className={classNames(classes.marginTop8,classes.displayFlex,classes.positionRelative)}>
-
+
{/*
@@ -1111,7 +1223,7 @@ const MobileAppFrame = (props) => {
*/}
-
history.push(`/@${username}`)} className={classNames((mode === 'night' || mode === 'gray')?'text-white':'text-black',classes.width100,classes.lineHeight24,classes.fontsize20,classes.fontWeight700,classes.displayFlex,classes.positionRelative,classes.justifyContentStart, classes.alignItemsCenter)}>

Profile

+
history.push(`/@${username}`)} className={classNames((mode === 'night' || mode === 'gray')?'text-white':'text-black',classes.width100,classes.lineHeight24,classes.fontsize20,classes.displayFlex,classes.positionRelative,classes.justifyContentStart, classes.alignItemsCenter)}>

Profile

@@ -1120,7 +1232,7 @@ const MobileAppFrame = (props) => {
- + {/*
{
*/}
-
Pockets
+
Bookmarks
- setShowSideBarNavigation(false)} className={classNames(classes.displayFlex,classes.positionRelative)}> +
showComingSoon()} className={classNames(classes.displayFlex,classes.positionRelative)}>
- + {/*
- + - + -
*/} +
*/}
-
Wallet
+
Communities
- -
showNotificationForMessage()} className={classNames(classes.displayFlex,classes.positionRelative)}> +
+
+
+
+
+
+ + + + {showProfessionalTools ? : } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {showSettingsAndSupport ? : } + + + + + + + + + + + + + + + + + + + + + + +
+ {/* setShowSideBarNavigation(false)} className={classNames(classes.displayFlex,classes.positionRelative)}>
- - {/*
- + +
+ - + -
*/} +
-
Message
+
Wallet
-
-
-
-
-
-
setOpenSettingsModal(true)} className={classNames(classes.displayFlex,classes.positionRelative)}> + */} + + {/*
setOpenSettingsModal(true)} className={classNames(classes.displayFlex,classes.positionRelative)}>
@@ -1198,8 +1370,8 @@ const MobileAppFrame = (props) => {
Settings
-
-
+
*/} + {/*
@@ -1213,7 +1385,7 @@ const MobileAppFrame = (props) => {
{(mode === 'night' || mode === 'gray')? 'Dark':'Light'}
-
+
*/} {/*
@@ -1348,7 +1520,7 @@ const MobileAppFrame = (props) => { onClick={handleClearNotification} /> )} - {title === 'Notifications' && } + {/*{title === 'Notifications' && }*/} {title === 'Search' && ( @@ -1377,7 +1549,7 @@ const MobileAppFrame = (props) => { )} -
+
{renderRoutes(route.routes)}
@@ -1393,29 +1565,7 @@ const MobileAppFrame = (props) => { - + ) } diff --git a/src/components/layout/OrganizationAppFrame/index.js b/src/components/layout/OrganizationAppFrame/index.js index 8dd754c6..ff63e1d6 100644 --- a/src/components/layout/OrganizationAppFrame/index.js +++ b/src/components/layout/OrganizationAppFrame/index.js @@ -69,7 +69,7 @@ const OrganizationAppBar = () => { const classes = useStyles() const { pathname } = useLocation() - const termsOfService = (pathname.match(/^\/\/tos/)) + const termsOfService = (pathname.match(/^\/tos/)) const privacyPolicy = (pathname.match(/^\/privacy/)) const disclaimer = (pathname.match(/^\/disclaimer/)) const getStarted = (pathname.match(/^\/getstarted/)) @@ -91,7 +91,6 @@ const OrganizationAppBar = () => { title = 'Leaderboard' } - return ( diff --git a/src/components/layout/SideBarLeft/index.js b/src/components/layout/SideBarLeft/index.js index 97721207..85bd1f98 100644 --- a/src/components/layout/SideBarLeft/index.js +++ b/src/components/layout/SideBarLeft/index.js @@ -19,6 +19,9 @@ import { CircularBrandIcon, // BuzzIcon, WalletIcon, + MessageIcon, + BookmarkIcon, + CommunityIcon, } from 'components/elements' import IconButton from '@material-ui/core/IconButton' import { @@ -33,7 +36,7 @@ import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import { pending } from 'redux-saga-thunk' import { signoutUserRequest, subscribeRequest } from 'store/auth/actions' -import { setBuzzModalStatus, setRefreshRouteStatus } from 'store/interface/actions' +import { broadcastNotification, setBuzzModalStatus, setRefreshRouteStatus } from 'store/interface/actions' import { generateStyles } from 'store/settings/actions' import { pollNotifRequest } from 'store/polling/actions' import moment from 'moment' @@ -120,11 +123,14 @@ const useStyles = createUseStyles(theme => ({ display: 'flex', flexDirection: 'column', justifyContent: 'start', - fontSize: 14, + fontSize: '20px', overflow: 'auto', overflowX: 'hidden', width: '100%', height: 'fit-content', + '& *': { + fontSize: '20px', + }, }, bottom: { position: 'absolute', @@ -200,20 +206,38 @@ const useStyles = createUseStyles(theme => ({ menu: { '& .MuiPaper-root': { background: theme.background.primary, + minWidth: '284px !important', }, '& ul':{ background: theme.background.primary, + '& nav':{ + background: theme.background.primary, + '& div':{ + background: theme.background.primary, + color: theme.font.color, + '& div':{ + '& div':{ + paddingLeft: '5%', + }, + }, + }, + }, }, '& li': { - fontSize: 18, - fontWeight: '500 !important', background: theme.background.primary, color: theme.font.color, - '&:hover': { ...theme.context.view, }, }, + '& *': { + fontSize: '15px !important', + fontWeight: '700 !important', + }, + '& #advanced-subheader': { + fontSize: '20px !important', + fontWeight: '700 !important', + }, }, moreButton: { display: 'flex', @@ -327,6 +351,7 @@ const SideBarLeft = (props) => { fromIntentBuzz, setRefreshRouteStatus, generateStyles, + broadcastNotification, } = props const { username, is_subscribe } = user || '' const [open, setOpen] = useState(false) @@ -347,6 +372,8 @@ const SideBarLeft = (props) => { const [ceramicUser, setCeramicUser] = useState(null) const [userAvatarUrl, setUserAvatarUrl] = useState('') const [fetchingUser, setFetchingUser] = useState(false) + const [showProfessionalTools, setShowProfessionalTools] = useState(false) + const [showSettingsAndSupport, setShowSettingsAndSupport] = useState(false) useEffect(() => { if(checkCeramicLogin(username)) { @@ -459,10 +486,32 @@ const SideBarLeft = (props) => { setOpenMoreMenu(true) } + const showComingSoon = () => { + broadcastNotification('success', `Coming soon`) + } + const handleClickCloseOpenMoreMenu = () => { setOpenMoreMenu(false) } + const toggleProfessionTools = () => { + setShowProfessionalTools(!showProfessionalTools) + } + + const toggleSettingsAndSupport = () => { + setShowSettingsAndSupport(!showSettingsAndSupport) + } + + const handelClickWallet = () => { + history.push(`/@${username}/wallet/balances`) + handelClickItem('wallet') + } + + const handleClickMessages = () => { + window.open("https://chat.d.buzz/") + handelClickItem('messages') + } + const handelClickItem = (name) => { switch(name) { case 'home': @@ -481,6 +530,14 @@ const SideBarLeft = (props) => { setActiveView(name) handleClickOpenMoreMenu() break + case 'messages': + setActiveView(name) + refreshTrendingRouteData() + break + case 'communities': + setActiveView(name) + showComingSoon() + break default: setActiveView(name) return @@ -488,29 +545,34 @@ const SideBarLeft = (props) => { } useEffect(() => { - switch(location.pathname) { - case '/': + switch (true) { + case location.pathname === '/': setActiveView('trending') break - case '/home': + case location.pathname === '/home': setActiveView('home') break - case '/latest': + case location.pathname === '/latest': setActiveView('latest') break - case '/notifications': + case location.pathname === '/communities': + setActiveView('communities') + break + case location.pathname === '/notifications': setActiveView('notifications') break - case '/profile': + case location.pathname === '/profile': setActiveView('profile') break - case `/@${username}/wallet/balances`: + case location.pathname === `/@${username}/wallet/balances`: setActiveView('wallet') break + case location.pathname.startsWith(`/@${username}/t/pockets/`): + setActiveView('pockets') + break default: return } - // eslint-disable-next-line }, [activeView]) @@ -547,18 +609,37 @@ const SideBarLeft = (props) => { icon: activeView === 'notifications' ? : , onClick: () => handelClickItem('notifications'), }, + { + name: 'Messages', + icon: activeView === 'messages' ? : , + path: '#', + preventDefault: true, + onClick: handleClickMessages, + }, + { + name: 'Bookmarks', + path: `/@${username}/t/pockets/`, + icon: activeView === 'pockets' ? : , + onClick: () => handelClickItem('pockets'), + }, + { + name: 'Communities', + path: `/communities`, + icon: activeView === 'communities' ? : , + onClick: () => handelClickItem('communities'), + }, { name: 'Profile', path: `/@${username}/t/buzz?from=nav`, icon: activeView === 'profile' ? : , onClick: () => handelClickItem('profile'), }, - { - name: 'Wallet', - icon: activeView === 'wallet' ? : , - path: `/@${username}/wallet/balances`, - onClick: () => handelClickItem('wallet'), - }, + // { + // name: 'Wallet', + // icon: activeView === 'wallet' ? : , + // path: `/@${username}/wallet/balances`, + // onClick: () => handelClickItem('wallet'), + // }, { name: 'More' , icon:
, @@ -590,6 +671,30 @@ const SideBarLeft = (props) => { preventDefault: false, onClick: () => handelClickItem('latest'), }, + { + name: 'Notifications', + path: `/notifications`, + icon: activeView === 'notifications' ? : , + onClick: () => handelClickItem('notifications'), + }, + { + name: 'Messages', + path: 'https://chat.d.buzz/', + icon: activeView === 'messages' ? : , + onClick: () => handelClickItem('messages'), + }, + { + name: 'Bookmarks', + path: `/@${username}/t/pockets/`, + icon: activeView === 'pockets' ? : , + onClick: () => handelClickItem('pockets'), + }, + { + name: 'Communities', + path: `/communities`, + icon: activeView === 'communities' ? : , + onClick: () => handelClickItem('communities'), + }, { name: 'Profile', path: `/@${username}/t/buzz?from=nav`, @@ -735,21 +840,110 @@ const SideBarLeft = (props) => { className={classes.menu} open={openMoreMenu} onClose={handleClickCloseOpenMoreMenu} + menuTitle='Advanced' + toggleProfessionTools={toggleProfessionTools} + toggleSettingsAndSupport={toggleSettingsAndSupport} items={[ + // { + // onClick: showThemeModal, + // text: 'Theme', + // visible: true, + // }, + // { + // onClick: showSwitchModal, + // text: 'Switch Account', + // visible: !ceramicUser ? true : false, + // }, + // { + // onClick: showSettingsModal, + // text: 'Settings', + // visible: true, + // }, { - onClick: showThemeModal, - text: 'Theme', + text: 'Professional Tools', visible: true, + collapse: showProfessionalTools, + onClick: toggleProfessionTools, + subItems: [ + { + subtext: 'Auto.Vote', + // icon: activeView === 'wallet' ? : , + subvisible: true, + subhref: 'https://auto.vote', + subonClick: '', + }, + { + subtext: 'Blog', + // icon: activeView === 'wallet' ? : , + subvisible: true, + subhref: 'http://blog.d.buzz/#/@'+username, + subonClick: '', + }, + { + subtext: 'DEX', + // icon: activeView === 'wallet' ? : , + subvisible: true, + subhref: 'https://dex.d.buzz', + subonClick: '', + }, + { + subtext: 'Leaderboard', + // icon: activeView === 'wallet' ? : , + subvisible: true, + subhref: 'https://d.buzz/leaderboard', + subonClick: '', + }, + { + subtext: 'Hive dApps', + // icon: activeView === 'wallet' ? : , + subvisible: true, + subhref: '', + subonClick: showComingSoon, + }, + ], }, { - onClick: showSwitchModal, - text: 'Switch Account', - visible: !ceramicUser ? true : false, + text: 'Settings & Support', + visible: true, + collapse: showSettingsAndSupport, + onClick: toggleSettingsAndSupport, + subItems: [ + { + subtext: 'Display', + // icon: activeView === 'wallet' ? : , + subvisible: true, + subhref: '', + subonClick: showThemeModal, + }, + { + subtext: 'Switch Account', + // icon: activeView === 'wallet' ? : , + subvisible: true, + subhref: '', + subonClick: showSwitchModal, + }, + { + subtext: 'Settings', + // icon: activeView === 'wallet' ? : , + subvisible: true, + subhref: '', + subonClick: showSettingsModal, + }, + { + subtext: 'Messages', + // icon: activeView === 'wallet' ? : , + subvisible: true, + subhref: 'https://chat.d.buzz/', + subonClick: '', + }, + ], }, { - onClick: showSettingsModal, - text: 'Settings', + text: 'Wallet', + icon: activeView === 'wallet' ? : , visible: true, + onClick: handelClickWallet, + subItems: [], }, ]} /> @@ -774,6 +968,7 @@ const mapDispatchToProps = (dispatch) => ({ setBuzzModalStatus, setRefreshRouteStatus, generateStyles, + broadcastNotification, }, dispatch), }) diff --git a/src/components/modals/EditProfileModal/index.js b/src/components/modals/EditProfileModal/index.js index 86c8e47c..f7e35628 100644 --- a/src/components/modals/EditProfileModal/index.js +++ b/src/components/modals/EditProfileModal/index.js @@ -259,7 +259,7 @@ const EditProfileModal = (props) => { byteArrays.push(byteArray) } - return new Blob(byteArrays, { type: contentType }) + return new Blob(byteArrays, {type: contentType}) } const handleError = (error) => { @@ -269,15 +269,15 @@ const EditProfileModal = (props) => { setImageUploadProgress(0) } - const handleInputType = (input) => { + const handleInputType = (input, username, type = 'profile') => { let originalFiles = [] if (input instanceof Blob) { - const croppedImageFile = new File([input], "cropped-image.png", { type: "image/png" }) + const croppedImageFile = new File([input], `${username}-${type}-image.png`, {type: "image/png"}) originalFiles = [croppedImageFile] } else if (typeof input === 'string' && input.startsWith('data:image/')) { const blob = base64ToBlob(input, 'image/png') - const croppedImageFile = new File([blob], "cropped-image.png", { type: "image/png" }) + const croppedImageFile = new File([blob], `${username}-${type}-image.png`, {type: "image/png"}) originalFiles = [croppedImageFile] } else if (input instanceof Event && input.target && input.target.files) { originalFiles = Array.from(input.target.files) @@ -290,8 +290,8 @@ const EditProfileModal = (props) => { } - const handleChangeProfileImage = async (input) => { - const originalFiles = handleInputType(input) + const handleChangeProfileImage = async (input, username) => { + const originalFiles = handleInputType(input, username) if (!originalFiles) return const allImages = [...originalFiles.filter(image => image.type !== 'image/heic')] @@ -305,7 +305,7 @@ const EditProfileModal = (props) => { quality: 1, }) allImages.push( - new File([pngBlob], image.name.replace('.heic', '.png'), { type: 'image/png', size: pngBlob.size }), + new File([pngBlob], image.name.replace('.heic', '.png'), {type: 'image/png', size: pngBlob.size}), ) }), ) @@ -333,8 +333,8 @@ const EditProfileModal = (props) => { } } - const handleChangeCoverImage = async (input) => { - const originalFiles = handleInputType(input) + const handleChangeCoverImage = async (input, username) => { + const originalFiles = handleInputType(input, username, 'cover') if (!originalFiles) return const allImages = originalFiles.filter(image => image.type !== 'image/heic') @@ -348,7 +348,7 @@ const EditProfileModal = (props) => { quality: 1, }) allImages.push( - new File([pngBlob], image.name.replace('.heic', '.png'), { type: 'image/png', size: pngBlob.size }), + new File([pngBlob], image.name.replace('.heic', '.png'), {type: 'image/png', size: pngBlob.size}), ) }), ) @@ -391,13 +391,13 @@ const EditProfileModal = (props) => { } - const handleCropComplete = (croppedImage) => { + const handleCropComplete = (croppedImage, username) => { switch (currentImageType) { case 'avatar': - handleChangeProfileImage(croppedImage) // Set the cropped image as the new profile image + handleChangeProfileImage(croppedImage, username) // Set the cropped image as the new profile image break case 'cover': - handleChangeCoverImage(croppedImage) + handleChangeCoverImage(croppedImage, username) break default: console.warn(`Unexpected image type: ${currentImageType}`) @@ -599,6 +599,7 @@ const EditProfileModal = (props) => { isOpen={isCropperOpen} onClose={() => setIsCropperOpen(false)} src={selectedImage} + username={username} onCropComplete={handleCropComplete} />
@@ -135,7 +139,7 @@ const FAQs = () => {

- HIVE is a crypto currency used to build decentralized applications, including social media platforms and NFT games. + HIVE is a versatile cryptocurrency designed to support decentralized applications. It's widely used in developing social media platforms and NFT-based games, promoting a new era of digital interaction and gaming.

@@ -143,12 +147,12 @@ const FAQs = () => {
-

What is decentralization?

+

What is Decentralization?


- Decentralization is a system or process that's controlled by a number of people, not just a centralized authority. + Decentralization refers to the distribution of control and decision-making across multiple entities or individuals, rather than being centralized in a single authority. This approach promotes greater transparency and inclusivity in systems and processes.

@@ -156,12 +160,12 @@ const FAQs = () => {
-

What is blockchain technology?

+

What is Blockchain Technology?


- A chain of records that's generally impossible to erase. + Blockchain technology is a revolutionary system of recording information in a way that makes it nearly impossible to change or hack. It's a digital ledger of transactions that is duplicated and distributed across the entire network of computer systems.

@@ -174,7 +178,7 @@ const FAQs = () => {

- DBuzz is a decentralized social media platform built on the Hive blockchain. + DBuzz is a decentralized social media platform, leveraging the Hive blockchain. It offers a new way of social interaction, free from central control, emphasizing user-generated content and community governance.

@@ -187,12 +191,25 @@ const FAQs = () => {

- Web1 is about reading, Web2 is about reading & writing (liking, commenting, etc) and Web3 is about reading, writing & owning (D.Buzz, Splinterlands, etc) a piece of the Internet. + Web3 represents the third generation of internet services. Unlike Web1, focused on reading, and Web2, on interaction (reading & writing), Web3 incorporates ownership elements (like in D.Buzz, Splinterlands), giving users a stake in the digital landscape.

+
+
+

Do DBuzz posts include a title section?

+
+
+
+

+ The first 82 characters of each Buzz are used to form a title section at the blockchain level to display properly on front-ends that use titles (PeakD.com, Ecency.com, etc.). +

+
+
+
+

TALKING POINTS :

@@ -211,7 +228,6 @@ const FAQs = () => {
-
diff --git a/src/components/pages/Feeds/index.js b/src/components/pages/Feeds/index.js index cd3a12ea..b8046c0a 100644 --- a/src/components/pages/Feeds/index.js +++ b/src/components/pages/Feeds/index.js @@ -43,7 +43,10 @@ const useStyles = createUseStyles(theme => ({ const Feeds = React.memo((props) => { const { - last, + last = { + permalink: '', + author: '', + }, loading, items, isHomeVisited, @@ -104,7 +107,6 @@ const Feeds = React.memo((props) => { clearScrollIndex() clearHomePosts() getHomePostsRequest() - setFeedPostsLoad(true) clearRefreshRouteStatus() } // eslint-disable-next-line @@ -120,24 +122,32 @@ const Feeds = React.memo((props) => { }, [last, loading]) useEffect(() => { - if (items.length === 0 && !loading && isFeedPostsLoaded) { - loadMorePosts() + const { permlink } = last + + if (items.length < 3 && !loading && isFeedPostsLoaded) { + if (permlink !== undefined ) { + loadMorePosts() + } else { + setFeedPostsLoad(true) + } + } else { + setFeedPostsLoad(true) } - }, [isFeedPostsLoaded, items.length, loadMorePosts, loading]) + }, [isFeedPostsLoaded, items.length, loadMorePosts, loading , last]) return ( {!isMobile && !buzzModalStatus && ()} - {(items.length === 0) && !loading && ( + {(items.length === 0 && isFeedPostsLoaded) && !loading && (
- Hi there! it looks like you haven't followed anyone yet,
- you may start following people by reading the  + Hi there! it looks like you haven't followed anyone yet,
+ you may start following people by reading the  latest
or trending  - buzzes on d.buzz today. + buzzes on d.buzz today.
diff --git a/src/components/pages/Latest/index.js b/src/components/pages/Latest/index.js index 88bab890..8351198c 100644 --- a/src/components/pages/Latest/index.js +++ b/src/components/pages/Latest/index.js @@ -149,8 +149,10 @@ const Latest = (props) => { }, [last]) useEffect(() => { - if (items.length === 0 && !loading && isLatestPostsLoaded) { + if (items.length < 3 && !loading && isLatestPostsLoaded) { loadMorePosts() + } else { + setLatestPostsLoaded(true) } }, [isLatestPostsLoaded, items.length, loadMorePosts, loading]) diff --git a/src/components/pages/Notification/index.js b/src/components/pages/Notification/index.js index bede68fa..0851b8cc 100644 --- a/src/components/pages/Notification/index.js +++ b/src/components/pages/Notification/index.js @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react' +import React, {useEffect, useState} from 'react' import Row from 'react-bootstrap/Row' import Col from 'react-bootstrap/Col' import moment from 'moment' @@ -13,6 +13,10 @@ import { bindActionCreators } from 'redux' import { anchorTop } from 'services/helper' import { isMobile } from 'react-device-detect' import { ContainedButton } from 'components/elements' +import { filterNotificationRequest } from 'store/polling/actions' +import {Tab, Tabs} from "@material-ui/core" +import Menu from "@material-ui/core/Menu" +import MenuItem from "@material-ui/core/MenuItem" const addHover = (theme) => { let style = { @@ -29,6 +33,55 @@ const addHover = (theme) => { } const useStyle = createUseStyles(theme => ({ + tabs: { + textTransform: 'none !important', + '&:hover': { + backgroundColor: { + ...theme.textArea, + }, + '& span': { + color: '#e53935', + }, + }, + '&.MuiTabs-indicator': { + backgroundColor: '#ffebee', + }, + '& span': { + fontFamily: 'Segoe-Bold', + fontWeight: 'bold', + ...theme.font, + }, + '& .MuiTab-root span.MuiTab-label': { + fontFamily: 'Segoe-Bold', + fontWeight: 'bold', + ...theme.font, + }, + '&.Mui-selected': { + '& span': { + color: '#e53935', + }, + }, + }, + tabsContainer: { + justifyContent: 'center', + }, + + topContainer: { + borderBottom: theme.border.primary, + '& label': { + fontFamily: 'Segoe-Bold', + paddingTop: 5, + '& span': { + color: '#d32f2f', + fontWeight: 400, + }, + }, + }, + tabContainer: { + '& span.MuiTabs-indicator': { + backgroundColor: '#e53935 !important', + }, + }, row: { width: '98%', margin: '0 auto', @@ -138,6 +191,9 @@ const useStyle = createUseStyles(theme => ({ fontWeight: 'bold', fontSize: 15, ...theme.font, + textAlign: 'center', + display: 'block', + margin: '0 auto', }, button: { '&:hover': { @@ -160,7 +216,7 @@ const Notification = (props) => { notifFilter, } = props - const classes = useStyle() + const { filterNotificationRequest } = props useEffect(() => { anchorTop() @@ -188,13 +244,12 @@ const Notification = (props) => { } const generateFilterDescription = () => { - let verb = `${notifFilter.toLowerCase().charAt(0).toUpperCase()+notifFilter.toLowerCase().slice(1)}s` + let verb = `${notifFilter.toLowerCase().charAt(0).toUpperCase()+notifFilter.toLowerCase().slice(1)}S` if(verb === 'Replys') { verb = 'Replies' } - - return `Showing ${verb}` + // return `Showing ${verb}` } const handleClickViewProfile = (username) => (e) => { @@ -202,63 +257,101 @@ const Notification = (props) => { window.open(`https://d.buzz/@${username}`, '_blank') } + const classes = useStyle() + const [selectedTab, setSelectedTab] = useState(0) + const [anchorEl, setAnchorEl] = useState(null) + + useEffect(() => { + anchorTop() + setPageFrom(null) + }, [setPageFrom]) + + const handleTabChange = (event, newValue) => { + setSelectedTab(newValue) + + switch (newValue) { + case 0: + filterNotificationRequest('ALL') + generateFilterDescription() + break + case 1: + filterNotificationRequest('MENTION') + generateFilterDescription() + break + default: + break + } + } + + const openMenu = (e) => { + setAnchorEl(e.currentTarget) + } + + const closeMenu = () => { + setAnchorEl(null) + } + + const handleFilterChange = (filter) => () => { + filterNotificationRequest(filter) + setAnchorEl(null) + } + return ( - {notifFilter !== 'ALL' && ( -
-
- - {generateFilterDescription()} - -
- )} +
+ + + + + + + + Votes + Follows + Replies + Reblogs + Transfers + + +
+ {/*{notifFilter !== 'ALL' &&
Showing {notifFilter}S
}*/} + {notifications.map((item, index) => ( - -
-
- - - -
- -
- - -
-
-
-
-
-
- - +
+
+ + + +
+ +
+ + +
- + +
+ +
- - - -
+
+ + +
+ +
+ + +
- +
))} - {(!loading && notifications.length === 0) && - (

You have no notifications
)} + {(!loading && notifications.length === 0) &&
You have no notifications
} ) @@ -274,6 +367,7 @@ const mapStateToProps = (state) => ({ const mapDispatchToProps = (dispatch) => ({ ...bindActionCreators({ setPageFrom, + filterNotificationRequest, }, dispatch), }) diff --git a/src/components/pages/Profile/index.js b/src/components/pages/Profile/index.js index 4daa7f81..f9eeb8ac 100644 --- a/src/components/pages/Profile/index.js +++ b/src/components/pages/Profile/index.js @@ -140,12 +140,14 @@ const useStyles = createUseStyles(theme => ({ width: 'inherit', ...theme.font, // fontWeight: 'bold', - fontFamily: 'Segoe', + fontFamily: 'Segoe-Bold', + fontSize: '14px', }, '&.Mui-selected': { '& span': { color: '#e53935', fontFamily: 'Segoe-Bold', + fontSize: '16px', }, }, }, @@ -287,6 +289,7 @@ const Profile = (props) => { const [followsYou, setFollowsYou] = useState(false) useEffect(() => { + if (profile.ceramic) { setCeramicProfile(profile.basic_profile) setCeramicUser(true) @@ -397,6 +400,7 @@ const Profile = (props) => { getAccountRepliesRequest(username) getFollowersRequest(username) getFollowingRequest(username) + reloadProfile() } setMoreButtonOptions() @@ -935,7 +939,7 @@ const Profile = (props) => { {!loading && !ceramic && } {!loading && !ceramic && - } + } {!loading && !ceramic && } diff --git a/src/components/pages/TermsConditions/index.js b/src/components/pages/TermsConditions/index.js index d8c5f6d0..8b10e4f3 100644 --- a/src/components/pages/TermsConditions/index.js +++ b/src/components/pages/TermsConditions/index.js @@ -121,7 +121,7 @@ const TermsConditions = () => {
  • For European Union (EU) Users
  • United States Legal Compliance
  • Severability and Waiver
  • -
  • Translation InterpretationS
  • +
  • Translation Interpretations
  • Changes to These Terms and Conditions
  • Contact Us
  • @@ -518,7 +518,7 @@ const TermsConditions = () => {
    -

    Translation Interpretation

    +

    Translation Interpretations


    diff --git a/src/components/sections/AccountPockets/index.js b/src/components/sections/AccountPockets/index.js index 3f8e1a70..c9794f43 100644 --- a/src/components/sections/AccountPockets/index.js +++ b/src/components/sections/AccountPockets/index.js @@ -132,12 +132,14 @@ const useStyle = createUseStyles(theme => ({ '& span': { ...theme.font, // fontWeight: 'bold', - fontFamily: 'Segoe', + fontFamily: 'Segoe-Bold', + fontSize: '14px', }, '&.Mui-selected': { '& span': { color: '#e53935', fontFamily: 'Segoe-Bold', + fontSize: '16px', }, }, }, diff --git a/src/components/sections/AccountPosts/index.js b/src/components/sections/AccountPosts/index.js index 54652376..78c8817f 100644 --- a/src/components/sections/AccountPosts/index.js +++ b/src/components/sections/AccountPosts/index.js @@ -1,4 +1,4 @@ -import React, { useCallback } from 'react' +import React, {useCallback, useEffect, useState} from 'react' import { connect } from 'react-redux' import { pending } from 'redux-saga-thunk' @@ -26,13 +26,33 @@ const AccountPosts = (props) => { mutelist, } = props const classes = useStyle() - const loadMorePosts = useCallback(() => { - try { + + const [isFeedPostsLoaded , setFeedPostsLoad] = useState(false) + + const loadMorePosts = useCallback(() => { + if (!loading) { const { permlink, author: start_author } = last getAccountPostsRequest(author, permlink, start_author) - } catch(e) { } + } // eslint-disable-next-line - }, [last]) + }, [last, loading]) + + useEffect(() => { + if (items.length < 3 && !loading && isFeedPostsLoaded) { + loadMorePosts() + } else { + setFeedPostsLoad(true) + } + }, [isFeedPostsLoaded, items.length, loadMorePosts, loading]) + + + // const loadMorePosts = useCallback(() => { + // try { + // const { permlink, author: start_author } = last + // getAccountPostsRequest(author, permlink, start_author) + // } catch(e) { } + // // eslint-disable-next-line + // }, [last]) const muted = mutelist.includes(author) @@ -42,8 +62,7 @@ const AccountPosts = (props) => { {!muted && ( - {(!loading && items.length === 0) && - (

    No Buzz's from @{author}
    )} + {(!loading && items.length === 0) && (

    No Buzz's from @{author}
    )}
    )} {muted &&

    This user is on your mutelist, unmute this user to view their buzzes
    } @@ -66,4 +85,4 @@ const mapDispatchToProps = (dispatch) => ({ }, dispatch), }) -export default connect(mapStateToProps, mapDispatchToProps)(AccountPosts) +export default connect(mapStateToProps, mapDispatchToProps)(AccountPosts) \ No newline at end of file diff --git a/src/components/sections/CreateBuzzForm/index.js b/src/components/sections/CreateBuzzForm/index.js index 35b729a6..d9990454 100644 --- a/src/components/sections/CreateBuzzForm/index.js +++ b/src/components/sections/CreateBuzzForm/index.js @@ -1537,7 +1537,7 @@ const CreateBuzzForm = (props) => { // genarate buzz permlink if video is attached useEffect(() => { if (videoLimit) { - setBuzzPermlink(createPermlink()) + setBuzzPermlink(createPermlink(buzzContent)) } else { setBuzzPermlink(null) } diff --git a/src/components/sections/WalletBalances/index.js b/src/components/sections/WalletBalances/index.js index 6ac73e6d..0242e211 100644 --- a/src/components/sections/WalletBalances/index.js +++ b/src/components/sections/WalletBalances/index.js @@ -61,14 +61,14 @@ const useStyles = createUseStyles(theme => ({ fontSize: 14, }, value : { - fontWeight: 'bold', + fontWeight: 'medium', paddingRight: 5, marginTop: 0, marginBottom: 0, paddingTop: 0, paddingBottom: 0, - color: '#e61c34', textAlign: 'end', + ...theme.hiveValuesFont, }, circle: { strokeLinecap: 'round', diff --git a/src/override.css b/src/override.css index 1972707a..6d03a6f2 100644 --- a/src/override.css +++ b/src/override.css @@ -114,8 +114,8 @@ div.ReactTags__selected a.ReactTags__remove { transition-property:'background-color'; transition-timing-function:ease; transition-duration: 250ms; - } + .navigationsmallWidth{ height: 100%; position: fixed; diff --git a/src/routes.js b/src/routes.js index 8b145499..4aa5b319 100644 --- a/src/routes.js +++ b/src/routes.js @@ -83,6 +83,11 @@ const routes = [ exact: true, component: Trending, }, + { + path: '/messages', + exact: true, + component: Trending, + }, { path: '/latest', exact: true, diff --git a/src/services/api.js b/src/services/api.js index b3da8a64..673ec5b9 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -1,16 +1,21 @@ -import {api, auth, broadcast, formatter} from '@hiveio/hive-js' +import { + api, + auth, + broadcast, + formatter, +} from '@hiveio/hive-js' import {hash} from '@hiveio/hive-js/lib/auth/ecc' import {Promise, reject} from 'bluebird' import {v4 as uuidv4} from 'uuid' import appConfig from 'config' -import config from 'config' import axios from 'axios' import getSlug from 'speakingurl' import moment from 'moment' import {ChainTypes, makeBitMaskFilter} from '@hiveio/hive-js/lib/auth/serializer' import 'react-app-polyfill/stable' import {calculateOverhead, stripHtml} from 'services/helper' -import {hacManualTransaction, hacUserAuth, hacVote} from "@mintrawa/hive-auth-client" +import {hacUserAuth, hacVote, hacManualTransaction} from "@mintrawa/hive-auth-client" +import config from 'config' const searchUrl = `${appConfig.SEARCH_API}/search` const scrapeUrl = `${appConfig.SCRAPE_API}/scrape` @@ -32,9 +37,9 @@ const visited = [] const defaultNode = process.env.REACT_APP_DEFAULT_RPC_NODE export const geRPCNode = () => { - return new Promise((resolve) => { - if (localStorage.getItem('rpc-setting')) { - if (localStorage.getItem('rpc-setting') !== 'default') { + return new Promise( (resolve) => { + if(localStorage.getItem('rpc-setting')) { + if(localStorage.getItem('rpc-setting') !== 'default') { const node = localStorage.getItem('rpc-setting') resolve(node) } else { @@ -71,7 +76,7 @@ export const invokeFilter = (item) => { } export const removeFootNote = (data) => { - if (typeof data !== 'string') { + if(typeof data !== 'string') { return data.forEach((item) => { item.body = item.body.replace('

    Posted via D.Buzz', '') item.body = item.body.replace('

    Posted via D.Buzz', '') @@ -128,7 +133,6 @@ export const searchPeople = (username) => { }) } - export const fetchDiscussions = (author, permlink) => { return new Promise((resolve, reject) => { const params = {"author": `${author}`, "permlink": `${permlink}`} @@ -415,7 +419,7 @@ export const fetchProfile = (username, checkFollow = false) => { return new Promise((resolve, reject) => { api.getAccountsAsync(username) .then(async (result) => { - if (result.length === 0) resolve(result) + if(result.length === 0) resolve(result) result.forEach(async (item, index) => { const repscore = item.reputation let score = formatter.reputation(repscore) @@ -818,7 +822,6 @@ export const publishPostWithHAS = async (user, body, tags, payout, perm) => { const permlink = perm ? perm : createPermlink(title) const operations = await hasGeneratePostService(user.username, title, tags, body, payout, permlink) - console.log(operations) hasPostService(operations[0]) const comment = operations[0] const json_metadata = comment[1].json_metadata @@ -1318,8 +1321,8 @@ export const generateUpdateOperation = (parent_author, parent_permlink, author, export const generateReplyOperation = (account, body, parent_author, parent_permlink) => { const json_metadata = createMeta() - let permlink = createPermlink(body.substring(0, 100)) - permlink = `re-${permlink}` + // let permlink = createPermlink(body.substring(0, 100)) + const permlink = `re-${parent_permlink}` return new Promise((resolve) => { const op_comment = [[ @@ -1478,11 +1481,56 @@ export const createMeta = (tags = []) => { return JSON.stringify(meta) } -export const createPermlink = (title) => { - const permlink = new Array(22).join().replace(/(.|$)/g, function () { - return ((Math.random() * 36) | 0).toString(36) +const STOP_WORDS = new Set([ + "a", "about", "actually", "almost", "also", "although", "always", "am", "an", + "and", "any", "are", "as", "at", "be", "became", "become", "but", "by", "can", + "could", "did", "do", "does", "each", "either", "else", "for", "from", "had", + "has", "have", "hence", "how", "i", "if", "in", "is", "it", "its", "just", "may", + "maybe", "me", "might", "mine", "must", "my", "neither", "nor", "not", "of", "oh", + "ok", "when", "where", "whereas", "wherever", "whenever", "whether", "which", "while", + "who", "whom", "whoever", "whose", "why", "will", "with", "within", "without", "would", + "yes", "yet", "you", "your", +]) + +function sanitizeTitle(title) { + return title.replace(/[^a-zA-Z0-9\s]/g, '') +} + +function generateSeoFriendlyPermalink(title) { + const words = title.split(' ').filter(word => { + const lowercased = word.toLowerCase() + return !STOP_WORDS.has(lowercased) && lowercased.length > 1 }) - return permlink + return words.join('-').toLowerCase() +} + +const MAX_CHARS = 20 + +function truncatePermlink(permlink) { + let truncated = permlink.substring(0, MAX_CHARS) + while (truncated.endsWith('-')) { + truncated = truncated.slice(0, -1) + } + return truncated +} + +function generateRandomString(length) { + return Array.from({ length }, () => (Math.random() * 36 | 0).toString(36)).join('') +} + +export const createPermlink = (title) => { + const sanitizedTitle = sanitizeTitle(title) + let seoFriendlyPermlink = generateSeoFriendlyPermalink(sanitizedTitle) + + console.log(seoFriendlyPermlink.length) + + if (seoFriendlyPermlink.length > MAX_CHARS) { + seoFriendlyPermlink = truncatePermlink(seoFriendlyPermlink) + } + + return seoFriendlyPermlink.length >= MAX_CHARS + ? seoFriendlyPermlink + : generateRandomString(MAX_CHARS) } @@ -1536,22 +1584,27 @@ export const searchPostAuthor = (author) => { export const searchPostGeneral = (query) => { return new Promise(async (resolve, reject) => { // const body = {query} - const {tag, sort} = query + const { tag , sort } = query axios({ method: 'POST', url: `${searchUrl}/query`, data: { - query: tag, - sort: sort, + query : tag, + sort : sort, }, }).then(async (result) => { const data = result.data if (data.results.length !== 0) { + console.log(data.results) const getProfiledata = mapFetchProfile(data.results, false) await Promise.all([getProfiledata]) + data.results = data.results.filter((item) => + item.body.length <= 280 && !item.permlink.startsWith('re-'), + ) + removeFootNote(data.results) - data.results = data.results.filter((item) => item.body.length <= 280) + } resolve(data) @@ -1575,8 +1628,9 @@ export const checkIfImage = (links) => { export const uploadImage = async (data, progress) => { const formData = new FormData() - formData.append('file', data) - + const customImageName = data.name.replace(/ /g, "-") + formData.append('file', data, data.name) + formData.append('customFileName', customImageName) return new Promise(async (resolve, reject) => { try { const response = await axios({ @@ -1597,9 +1651,9 @@ export const uploadImage = async (data, progress) => { reject(error) } }) - } + export const uploadVideo = async (data, username, progress) => { const formData = new FormData() formData.append('username', username) @@ -1746,7 +1800,6 @@ export const generateClaimRewardOperation = (account, reward_hive, reward_hbd, r export const getEstimateAccountValue = (account) => { return new Promise(async (resolve) => { - console.log(account) await formatter.estimateAccountValue(account) .catch(function (err) { console.log(err) diff --git a/src/services/ceramic.js b/src/services/ceramic.js index 18433eca..4ec59cd3 100644 --- a/src/services/ceramic.js +++ b/src/services/ceramic.js @@ -1,36 +1,31 @@ +import { ApolloClient, InMemoryCache } from '@apollo/client' +import { isMobile } from 'react-device-detect' +import { EthereumProvider } from '@walletconnect/ethereum-provider' +import { DID } from 'dids' +import { Ed25519Provider } from 'key-did-provider-ed25519' +import { getResolver } from 'key-did-resolver' +import Web3 from 'web3' +import * as Web3Modal from 'web3modal' +import * as SpkNetwork from '@spknetwork/graph-client' +import axios from "axios" import { CeramicClient } from '@ceramicnetwork/http-client' - -let axios - -import('axios').then((Axios) => { - axios = Axios +import { IDX } from '@ceramicstudio/idx' +import { fromString } from 'uint8arrays' +import { hash } from '@stablelib/sha256' + +// const hosts = [ +// 'https://ceramic.3speak.tv', +// 'https://ceramic.web3telekom.xyz', +// 'https://ceramic-node.vitalpointai.com', +// ] + +export const unionIndexerClient = new ApolloClient({ + uri: 'https://union.us-02.infra.3speak.tv/api/v2/graphql', + cache: new InMemoryCache(), }) -const hosts = [ - 'https://ceramic.3speak.tv', - 'https://ceramic.web3telekom.xyz', - 'https://ceramic-node.vitalpointai.com', -] - export const getBestCeramicHost = async() => { - const hostsWithTimes = [] - const times = [] - let fastestHost = 'https://ceramic.3speak.tv' - await Promise.all( - hosts.map(async (host) => { - try { - const start = Date.now() - await axios.get(`${host}/api/v0/streams/kjzl6cwe1jw149xy2w2qycwts4xjpvyzrkptdw20iui7r486bd6sasqb9tgglzp`) - .then(() => { - const finish = Date.now() - hostsWithTimes.push({host, time: (finish - start) / 1000}) - times.push((finish - start) / 1000) - }) - } catch(err) { return } - })) - .then(() => { - fastestHost = (hostsWithTimes.find(h => h.time === Math.min(...times))).host - }) + const fastestHost = 'https://ceramic.3speak.tv' return fastestHost } @@ -42,48 +37,26 @@ const normalizeAuthSecret = (authSecret64) => { return authSecret } -const providerOptions = { - /* See Provider Options Section */ -} - -let web3Modal -let web3 - -// dynamic imports - -import('web3modal').then((Web3Modal) => { - web3Modal = new Web3Modal.default({ - network: "mainnet", // optional - cacheProvider: true, // optional - providerOptions, // required - }) +const web3Modal = new Web3Modal.default({ + network: "mainnet", + cacheProvider: true, + providerOptions: {}, }) -import('web3').then((Web3) => { - web3 = new Web3.default() -}) +const web3 = new Web3() const idxAliases = { rootPosts: 'ceramic://kjzl6cwe1jw149xy2w2qycwts4xjpvyzrkptdw20iui7r486bd6sasqb9tgglzp', socialConnectionIndex: 'ceramic://kjzl6cwe1jw145f1327br2k7lkd5acrn6d2omh88xjt70ovnju491moahrxddns', } -export const API_NODE = 'https://us-01.infra.3speak.tv' - -let idx -let spk +export const SPK_INDEXER_HOST = 'https://offchain.us-02.infra.3speak.tv' -const Ceramic = new CeramicClient(localStorage.getItem('ceramic') || hosts[0]) - -// dynamic imports -import('@ceramicstudio/idx').then((CeramicStudio) => { - idx = new CeramicStudio.IDX({ceramic: Ceramic, aliases: idxAliases}) -}) -import('@spknetwork/graph-client').then((SpkNetwork) => { - spk = new SpkNetwork.SpkClient(API_NODE, Ceramic) -}) +const ceramicClient = new CeramicClient('https://ceramic.us-02.infra.3speak.tv') +const spk = new SpkNetwork.SpkClient(SPK_INDEXER_HOST, ceramicClient) +const idx = new IDX({ceramic: ceramicClient, aliases: idxAliases}) -window.ceramicclient = Ceramic +window.ceramicclient = ceramicClient window.idxclient = idx window.spkclient = spk @@ -101,23 +74,20 @@ const connectPrompt = async() => { return firstAccount } -const resloveEthDid = async(did) => { - let proof - let verified - const account = await web3.eth.getAccounts().then(data=>data[0]) - await import('3id-blockchain-utils').then(async(utils) => { - proof = await utils.createLink(did, `${account}@eip155:1`, web3.eth.currentProvider) - verified = await utils.validateLink(proof) - }) +// const resolveEthDid = async(did, provider) => { +// const account = await provider.getAccounts().then(data=>data[0]) - // await authenticate(proof.message, `${account}@eip155:1`, web3.eth.currentProvider) +// const proof = await utils.createLink(did, `${account}@eip155:1`, provider.currentProvider) +// const verified = await utils.validateLink(proof) - return verified -} +// await authenticate(proof.message, `${account}@eip155:1`, provider.currentProvider) + +// return verified +// } export const authenticateWithCeramic = (did, secret) => { - Ceramic.setDID(did) + ceramicClient.setDID(did) const ceramicAuth = {authDID: did.id, authSecret: secret} localStorage.setItem('ceramic.auth', JSON.stringify(ceramicAuth)) } @@ -126,7 +96,7 @@ export const reauthenticateWithCeramic = async() => { const auth = JSON.parse(localStorage.getItem('ceramic.auth')) const secret = Object.values(auth.authSecret) const did = await createIdentity(secret) - Ceramic.setDID(did) + ceramicClient.setDID(did) } const getCeramicAuth = () => { @@ -140,62 +110,83 @@ export const checkCeramicLogin = () => { return ceramicAuth } -const createIdentity = async(authSecret) => { - let provider - let resolver - import('key-did-provider-ed25519').then((keyDidProvider) => { - provider = new keyDidProvider.Ed25519Provider(authSecret) - }) - import('key-did-resolver').then((keyDidResolver) => { - resolver = keyDidResolver.getResolver() - }) - let did - await import('dids').then((dids) => { - did = new dids.DID({ provider, resolver }) - }) - - await did.authenticate() - - return did +const createIdentity = async(seed) => { + try { + const provider = new Ed25519Provider(seed) + const did = new DID({ provider, resolver: getResolver() }) + await did.authenticate() + return did + } + catch(err) { + console.log(err) + } } -let hash -let fromString -import('@stablelib/sha256').then((SHA) => { - hash = SHA.hash -}) -import('uint8arrays').then((Unit8Arrays) => { - fromString = Unit8Arrays.fromString -}) - export const loginWithMetaMask = async() => { - const account = await connectPrompt() - const info = await web3.eth.personal.sign('Allow this account to control your identity', account) - const authSecret = normalizeAuthSecret(hash(fromString(info.slice(2)))) + let signedMessage + + const walletConnectProvider = await EthereumProvider.init({ + projectId: '686fee168a35f3cd368400c22a86860a', + chains: [1], + showQrModal: true, + methods: ['personal_sign', 'eth_requestAccounts'], + events: [], + qrModalOptions: { + themeMode: 'light', + themeVariables: { + "--wcm-z-index": 9999, + }, + }, + }) + + if (!isMobile) { + const account = await connectPrompt() + if (account) { + signedMessage = await web3.eth.personal.sign('Allow this account to control your identity', account) + } + } else { + try { + await walletConnectProvider.connect() + const accounts = await walletConnectProvider.request({ method: 'eth_requestAccounts' }) + const account= accounts[0] + signedMessage = await walletConnectProvider.request({ method: 'personal_sign', params: ['Allow this account to control your identity', account] }) + } catch (error) { + console.error("Failed to connect:", error) + } + } - const did = await createIdentity(authSecret) - const proof = await resloveEthDid(did.id) + const authSecret = normalizeAuthSecret(hash(fromString(signedMessage.slice(2)))) + const did = await createIdentity(authSecret) - if(proof) { + if(did) { authenticateWithCeramic(did, authSecret) } - return proof ? did : null + return did ? did : 0 } export const checkForCeramicAccount = (account) => { return (account || '').startsWith('did:key:') } -export const createPostRequest = async(did, title, body) => { - return await spk.createDocument({ - app: 'dBuzz', - title: title, - body: body, - debug_metadata: { - user_id: did, - }, - }) + +export const createPostRequest = async(did, body) => { + try { + return await spk.createDocument({ + title: '', + body: body, + json_metadata: { + app: 'dBuzz', + }, + debug_metadata: { + did: did, + }, + app: 'dBuzz', + }, null) + } + catch(err) { + console.log(err.message) + } } export const updatePostRequest = async(parentId, body) => { @@ -214,11 +205,18 @@ export const replyRequest = async(parentId, did, body) => { }, parentId) } +export const generateHiveCeramicParentId = async (author, permlink) => { + return (await axios.post("https://union.us-02.infra.3speak.tv/api/v1/create_stream_id", { + author, + permlink, + })).data?.stream_id +} + export const getUserPostRequest = async(did) => { const posts = [] if(did) { - const { data } = await axios.post(`${API_NODE}/v1/graphql`, { + const { data } = await axios.post(`${SPK_INDEXER_HOST}/v1/graphql`, { query: ` { publicFeed(parent_id:null, creator_id:"${did}") { @@ -285,7 +283,7 @@ export const getUserPostRequest = async(did) => { export const getChildPostsRequest = async(parentId) => { const posts = [] if(parentId) { - const { data } = await axios.post(`${API_NODE}/v1/graphql`, { + const { data } = await axios.post(`${SPK_INDEXER_HOST}/v1/graphql`, { query: ` { publicFeed(parent_id:"${parentId}") { @@ -392,7 +390,7 @@ export const getSinglePost = async(streamId) => { export const getBasicProfile = async(did) => { let profileData if(did) { - const { data } = await axios.post(`${API_NODE}/v1/graphql`, { + const { data } = await axios.post(`${SPK_INDEXER_HOST}/v1/graphql`, { query: ` { ceramicProfile(userId: "${did}") { @@ -446,15 +444,21 @@ export const setBasicProfile = async(profile) => { }) } -export const getIpfsLink = (hash) => { - return `https://ipfs.io/ipfs/${hash.replace('ipfs://', '')}` +export const getIpfsLink = (hash='') => { + if(!!hash) { + if(hash.startsWith('ipfs://')) { + return `https://ipfs.io/ipfs/${hash.replace('ipfs://', '')}` + } else { + return hash + } + } } export const getFollowingList = async(did) => { let following if(did) { - const { data } = await axios.post(`${API_NODE}/v1/graphql`, { + const { data } = await axios.post(`${SPK_INDEXER_HOST}/v1/graphql`, { query: ` { following(did: "${did}") { @@ -484,7 +488,7 @@ export const getFollowersList = async(did) => { let followers if(did) { - const { data } = await axios.post(`${API_NODE}/v1/graphql`, { + const { data } = await axios.post(`${SPK_INDEXER_HOST}/v1/graphql`, { query: ` { followers(did: "${did}") { @@ -545,7 +549,7 @@ export const getFollowingFeed = async (did) => { const feed = [] if(did) { - const { data } = await axios.post(`${API_NODE}/v1/graphql`, { + const { data } = await axios.post(`${SPK_INDEXER_HOST}/v1/graphql`, { query: ` { followingFeed(did: "${did}") { diff --git a/src/services/helper.js b/src/services/helper.js index 34e0640a..9868f125 100644 --- a/src/services/helper.js +++ b/src/services/helper.js @@ -523,7 +523,7 @@ export const isImageUrl404 = async (url) => { } export const proxyImage = (url) => { - const enabled = true + const enabled = false let imageUrl = url if(enabled) { diff --git a/src/services/theme.js b/src/services/theme.js index 00fca101..44f7f9a5 100644 --- a/src/services/theme.js +++ b/src/services/theme.js @@ -67,6 +67,9 @@ const night = { font: { color: 'rgb(255, 255, 255) !important', }, + hiveValuesFont: { + color: 'white !important', + }, textIcon : { color: 'rgb(136, 153, 166)', }, @@ -248,6 +251,9 @@ const light = { font: { color: 'black !important', }, + hiveValuesFont: { + color: 'black !important', + }, border: { primary: '1px solid #e6ecf0', thick: '10px solid #e6ecf0', diff --git a/src/store/posts/sagas.js b/src/store/posts/sagas.js index 5adb04ce..43e64958 100644 --- a/src/store/posts/sagas.js +++ b/src/store/posts/sagas.js @@ -311,7 +311,7 @@ function* getHomePostsRequest(payload, meta) { const user = yield select(state => state.auth.get('user')) const {username: account} = user - const params = {sort: 'feed', account, limit: 20, start_permlink, start_author} + const params = {sort: 'feed', account, limit: 50, start_permlink, start_author} const method = 'get_account_posts' try { @@ -356,7 +356,8 @@ function* getLatestPostsRequest(payload, meta) { const censoredList = yield select(state => state.auth.get('censorList')) const {start_permlink, start_author} = payload - const params = {sort: 'created', start_permlink, start_author, limit: 50} + + const params = {sort: 'created', start_permlink, start_author, limit: 20} const method = 'get_ranked_posts' try { diff --git a/src/store/profile/sagas.js b/src/store/profile/sagas.js index 9b3cd4f1..5a6fb7bf 100644 --- a/src/store/profile/sagas.js +++ b/src/store/profile/sagas.js @@ -188,8 +188,11 @@ function* getAccountPostRequest(payload, meta) { return arr.map(mapObj => mapObj['post_id']).indexOf(obj['post_id']) === pos }) + data = data.filter(item => invokeFilter(item)) + console.log(data) + const censoredList = yield select(state => state.auth.get('censorList')) data.map((item) => censorCheck(item, censoredList))