Skip to content

Commit

Permalink
prepare 3.46.0 (#1227)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaashir authored Feb 9, 2024
1 parent 5df888c commit d2dbfa7
Show file tree
Hide file tree
Showing 34 changed files with 1,139 additions and 473 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -163,4 +163,4 @@
"browser": {
"process": "process/browser.js"
}
}
}
2 changes: 1 addition & 1 deletion public/widgets/buzzWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@
__dbuzzwidget.i();
}
};
}));
}));
2 changes: 1 addition & 1 deletion public/widgets/buzz_button.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
const buzzButton=new BuzzButton();buzzButton.i()})
</script>
</body>
</html>
</html>
11 changes: 11 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<React.Fragment>
<React.Suspense fallback={<span> </span>}>
Expand Down
29 changes: 10 additions & 19 deletions src/components/common/HelmetGenerator/index.js
Original file line number Diff line number Diff line change
@@ -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(() => {
Expand All @@ -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)} ...`
Expand All @@ -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
}

Expand All @@ -65,16 +50,22 @@ const HelmetGenerator = (props) => {
<Helmet>
<title>{title}</title>
<meta property="description" content={description} />
<meta property="image" content={image} />
<meta property="image" content="https://d.buzz/dbuzz.svg" />
<meta property="image:width" content="1200" />
<meta property="image:height" content="628" />
<meta property="og:url" content={url} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={image} />
<meta property="og:image" content="https://d.buzz/dbuzz.svg" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="628" />
<meta property="title" content={title} />
<meta property="twitter:url" content={url} />
<meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} />
<meta property="twitter:image" ccontent={image} />
<meta property="twitter:image" content="https://d.buzz/dbuzz.svg" />
<meta property="twitter:image:width" content="1200" />
<meta property="twitter:image:height" content="628" />
</Helmet>
)}
{page !== 'content' && (
Expand Down
8 changes: 4 additions & 4 deletions src/components/common/ImageCropper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ const useStyles = createUseStyles(theme => ({
background: '#F5F8FA',
marginRight: 8,
color: '#000000 !important',

'&:hover': {
background: '#EDF0F2',
},

'&:active': {
background: '#EDF0F2 !important',
},
Expand All @@ -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)
Expand All @@ -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 {
Expand Down
80 changes: 73 additions & 7 deletions src/components/common/MoreMenu/index.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -24,7 +31,11 @@ const MoreMenu = (props) => {
setcallFunc(onClick)
setOverflow('scroll')
}


const handleClickCollapse = (onClick) => () => {
setcallFunc(onClick)
}

useEffect(() => {
// console.log(open, themeModal, switchUserModal)
setcallFunc(callFunc)
Expand All @@ -36,19 +47,74 @@ const MoreMenu = (props) => {
}
// eslint-disable-next-line
}, [open, themeModal, switchUserModal])

return (
<Menu
style={{ zIndex: 3500 }}
anchorEl={() => anchor.current}
open={open}
onClose={onClose}
className={className}
transformOrigin={{vertical: 'bottom', horizontal: 'top'}}
transformOrigin={{vertical: 'top', horizontal: 'top'}}
>
{items.map(({onClick, text, visible}) => (
visible && <MenuItem onClick={handleMenuClosing(onClick)} key={text} style={{ minWidth: 150 }}>{text}</MenuItem>
))}
<List
component="nav"
aria-labelledby="advanced-subheader"
subheader={<ListSubheader component="div" id="advanced-subheader" style={{ fontSize: '20px !important', fontWeight: '700 !important' }}>
Advanced
</ListSubheader>}
style={{
maxHeight: '400px', // Adjust this value based on your needs
overflowY: 'auto', // This makes the list scrollable
}}
>
<Divider />
{items.map(({onClick, text, visible, subItems, collapse}) => (
visible &&
(
Object.keys(subItems).length > 0 ? (
<>
<ListItem button onClick={handleClickCollapse(onClick)}>
{/* <ListItemIcon>
<InboxIcon />
</ListItemIcon> */}
<ListItemText primary={text}/>
{collapse ? <ExpandLess /> : <ExpandMore />}
</ListItem>
<Collapse in={collapse} timeout="auto" unmountOnExit>
{subItems.map(({subonClick, subtext, subhref}) => (
subhref === '' ?
<List component="div">
<ListItem onClick={handleMenuClosing(subonClick)} key={text} button>
{/* <ListItemIcon>
<StarBorder />
</ListItemIcon> */}
<ListItemText primary={subtext} />
</ListItem>
</List>
:
<List component="div">
<ListItem component="a" href={subhref} target="_blank" rel="noopener noreferrer" key={text} button>
{/* <ListItemIcon>
<StarBorder />
</ListItemIcon> */}
<ListItemText primary={subtext} />
</ListItem>
</List>

))}
</Collapse>
</>
)
:
<ListItem button>
{/* <ListItemIcon>
<InboxIcon />
</ListItemIcon> */}
<ListItemText onClick={handleMenuClosing(onClick)} key={text} primary={text} />
</ListItem>
)
))}
</List>
</Menu>
)
}
Expand Down
10 changes: 6 additions & 4 deletions src/components/common/UserDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}`)
}
Expand All @@ -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}`)
}
Expand Down Expand Up @@ -276,7 +278,7 @@ const UserDialog = React.memo((props) => {
<div className={classes.right}>
{is_authenticated && (
<React.Fragment>
{((!isFollowed && !hasRecentlyFollowed) || hasRecentlyUnfollowed) && (username !== author) && (
{!isFollowed && (username !== author) && (
<ContainedButton
fontSize={14}
loading={loading || detailsFetching}
Expand All @@ -288,7 +290,7 @@ const UserDialog = React.memo((props) => {
onClick={followUser}
/>
)}
{((isFollowed || hasRecentlyFollowed) && !hasRecentlyUnfollowed) && (username !== author) && (
{isFollowed && (username !== author) && (
<ContainedButton
fontSize={14}
loading={loading || detailsFetching}
Expand Down
23 changes: 17 additions & 6 deletions src/components/elements/Icons/BookmarkIcon/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import React from 'react'

const BookmarkIcon = () => {
const BookmarkIcon = ({ height = 20, top = 0, type }) => {
// return (
// <svg height="20" viewBox="0 0 24 24">
// <g>
// <path strokeWidth="0.3" stroke="rgb(101, 119, 134)" d="M4 4.5C4 3.12 5.119 2 6.5 2h11C18.881 2 20 3.12 20 4.5v18.44l-8-5.71-8 5.71V4.5zM6.5 4c-.276 0-.5.22-.5.5v14.56l6-4.29 6 4.29V4.5c0-.28-.224-.5-.5-.5h-11z"></path>
// </g>
// </svg>
// )
return (
<svg height="20" viewBox="0 0 24 24">
<g>
<path strokeWidth="0.3" stroke="rgb(101, 119, 134)" d="M4 4.5C4 3.12 5.119 2 6.5 2h11C18.881 2 20 3.12 20 4.5v18.44l-8-5.71-8 5.71V4.5zM6.5 4c-.276 0-.5.22-.5.5v14.56l6-4.29 6 4.29V4.5c0-.28-.224-.5-.5-.5h-11z"></path>
</g>
</svg>
type === 'outline' ?
<svg height="25" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path style={{ strokeWidth: '0'}} d="M4 4.5C4 3.12 5.119 2 6.5 2h11C18.881 2 20 3.12 20 4.5v18.44l-8-5.71-8 5.71V4.5zM6.5 4c-.276 0-.5.22-.5.5v14.56l6-4.29 6 4.29V4.5c0-.28-.224-.5-.5-.5h-11z" fill="#e61c34"/>
</svg>
:
<svg height="25" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path style={{ strokeWidth: '0'}} d="M4 4.5C4 3.12 5.119 2 6.5 2h11C18.881 2 20 3.12 20 4.5v18.44l-8-5.71-8 5.71V4.5z" fill="#e61c34"/>
</svg>

)
}

Expand Down
15 changes: 15 additions & 0 deletions src/components/elements/Icons/CommunityIcon/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions src/components/layout/GuardedAppFrame/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -287,7 +292,7 @@ const GuardedAppFrame = (props) => {
</IconButton>
)}
{title !== 'Search' && (<span className={classes.title}>{title}</span>)}
{title === 'Notifications' && <NotificationFilter />}
{/*{title === 'Notifications' && <NotificationFilter />}*/}
</Navbar.Brand>
{title === 'Search' && (
<div className={classes.searchDiv}>
Expand Down Expand Up @@ -326,7 +331,7 @@ const GuardedAppFrame = (props) => {
{renderRoutes(route.routes)}
{minify && (
<Fab onClick={handleOpenBuzzModal} size="medium" color="secondary" aria-label="add" style={{...floatStyle, ...floatingButtonStyle}}>
<CreateBuzzIcon />
<CreateBuzzIcon fill={floatStyle.fill}/>
</Fab>
)}
<BuzzFormModal show={open} onHide={onHide} />
Expand Down
Loading

0 comments on commit d2dbfa7

Please sign in to comment.