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

Sprint 30 #2247

Merged
merged 48 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c90f97f
about page root common: show join common button
roienatan Oct 19, 2023
ab79367
clean in MembershipRequestIntroduce
roienatan Oct 19, 2023
da5dda4
fix: chat input rtl emoji container blocks cursor
roienatan Oct 22, 2023
532bbe1
join via is now button instead of text link
roienatan Oct 22, 2023
d4118d2
remove `Edit profile` button on mobile
andreymikhadyuk Oct 23, 2023
e162ab9
Merge pull request #2225 from daostack/feature/CW-2194-remove-edit-pr…
andreymikhadyuk Oct 23, 2023
bfd5174
update isJoinAllowed condition
roienatan Oct 23, 2023
3bed749
Merge pull request #2224 from daostack/cw-2223-fix-chat-input-hebrew-…
roienatan Oct 23, 2023
f36f262
add sorting to the feed item list
andreymikhadyuk Oct 23, 2023
53a3e6c
add sorting to update list of inbox items
andreymikhadyuk Oct 23, 2023
e389ed9
disable scroll anchor for feed item list
andreymikhadyuk Oct 23, 2023
14c3192
bring back withJoinRequest
roienatan Oct 23, 2023
7540c29
message loading skeleton
roienatan Oct 23, 2023
66b5442
Merge pull request #2231 from daostack/feature/CW-2212-feed-sorting
andreymikhadyuk Oct 24, 2023
f97c1f1
remove extra fetches of breadcrumbs data
andreymikhadyuk Oct 24, 2023
0f49b31
create useAllUserCommonMemberInfo hook
andreymikhadyuk Oct 24, 2023
77a3311
create useGovernanceListByCommonIds hook
andreymikhadyuk Oct 24, 2023
b3d8bc4
add logic to fetch breadcrumbs item's projects
andreymikhadyuk Oct 24, 2023
8ba67f2
add logic to display add space button
andreymikhadyuk Oct 24, 2023
740de9d
landing page: remove video animation ; remove unnecessary images
roienatan Oct 24, 2023
0c600df
reuse commons and projects from sidenav in breadcrumbs
andreymikhadyuk Oct 24, 2023
b84ba8a
add loader to breadcrumbs menu
andreymikhadyuk Oct 24, 2023
f411c98
create ActiveFeedBreadcrumbsItem component
andreymikhadyuk Oct 24, 2023
7577090
fix breadcrumbs related reducers
andreymikhadyuk Oct 24, 2023
d6f7c27
fix active breadcrumbs items
andreymikhadyuk Oct 24, 2023
c91dec2
revert breadcrumbs items type
andreymikhadyuk Oct 24, 2023
3733875
add comment to the addOrUpdateProjectInBreadcrumbs reducer
andreymikhadyuk Oct 24, 2023
8836b56
updated system message design
roienatan Oct 24, 2023
a01f32e
fix FeedBreadcrumbsItem's base item building
andreymikhadyuk Oct 24, 2023
742d3fc
optimize breadcrumbs configuration using existing data
andreymikhadyuk Oct 24, 2023
7d47273
fix projects in sidenav fetch on item click from breadcrumbs
andreymikhadyuk Oct 24, 2023
6e1ba0d
fix projects in sidenav fetch on item click from breadcrumbs
andreymikhadyuk Oct 24, 2023
5c7cad7
close message menu on chat scrolling
budnik9 Oct 24, 2023
39b20f6
CW-2227 Revert routing to new inbox
pvm-code Oct 25, 2023
8d633f9
Merge pull request #2219 from daostack/cw-2217-about-root-common-join…
roienatan Oct 25, 2023
1b4e27b
Merge pull request #2244 from daostack/feature/CW-2146-hide-message-menu
pvm-code Oct 25, 2023
9ac1ca4
loading... label instead of animation
roienatan Oct 25, 2023
de1bc73
updated color text
roienatan Oct 25, 2023
5140f43
updates
roienatan Oct 25, 2023
75a947a
clean
roienatan Oct 25, 2023
3d321d0
CW-2227 Revert sidenav to v04
pvm-code Oct 25, 2023
441d1e0
Merge pull request #2232 from daostack/cw-2192-message-item-loading-s…
pvm-code Oct 25, 2023
1b5b75d
Merge pull request #2242 from daostack/cw-2238-updated-system-message…
pvm-code Oct 25, 2023
5e7efdc
Merge pull request #2246 from daostack/CW-2227-revert-v04-sidenav
pvm-code Oct 25, 2023
3de41c9
Merge pull request #2243 from daostack/feature/CW-2234-breadcrumbs
pvm-code Oct 25, 2023
dc85068
useBigPhoneView
roienatan Oct 25, 2023
f72a877
Merge pull request #2241 from daostack/cw-2235-landing-page-remove-video
roienatan Oct 25, 2023
51ce064
Merge branch 'staging' into dev
pvm-code Oct 25, 2023
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
26 changes: 0 additions & 26 deletions public/assets/images/apps-qr.svg

This file was deleted.

Binary file removed public/assets/images/iphone-full-1.png
Binary file not shown.
Binary file removed public/assets/images/iphone-full-2.png
Binary file not shown.
Binary file removed public/assets/images/iphone-full-3.png
Binary file not shown.
Binary file removed public/assets/images/iphone-half-1.png
Binary file not shown.
Binary file removed public/assets/images/iphone-half-2.png
Binary file not shown.
Binary file removed public/assets/images/iphone-half-3.png
Binary file not shown.
Binary file removed public/assets/images/iphone-half-desktop.png
Binary file not shown.
Binary file removed public/assets/images/iphone-half-mobile.png
Binary file not shown.
Binary file removed public/assets/images/join-mobile.jpg
Binary file not shown.
Binary file removed public/assets/images/join.jpg
Binary file not shown.
Binary file added public/assets/images/landing-mobile-poster.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/assets/images/main-landing-image-1.jpg
Binary file not shown.
Binary file removed public/assets/images/main-landing-image-2.jpg
Binary file not shown.
Binary file removed public/assets/images/main-landing-image-3.jpg
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { FC } from "react";
import { useTranslation } from "react-i18next";
import landingVideoPosterSrc from "@/shared/assets/images/landing-video-poster.jpeg";
import landingVideoPosterSrc from "@/shared/assets/images/landing-video-poster.jpg";
import landingVideoSrc from "@/shared/assets/videos/landing-video.mp4";
import { useIsBigPhoneView } from "@/shared/hooks/viewport";
import { Button, ButtonVariant } from "@/shared/ui-kit";
import "./index.scss";

Expand All @@ -13,21 +14,24 @@ const VideoSection: FC<VideoSectionProps> = ({ onLaunchClick }) => {
const { t } = useTranslation("translation", {
keyPrefix: "landing",
});
const isBigPhoneView = useIsBigPhoneView();

return (
<section className="landing-video-section">
<div className="landing-video-section__video-wrapper">
<video
className="landing-video-section__video"
autoPlay
loop
muted
playsInline
poster={landingVideoPosterSrc}
preload="auto"
>
<source src={landingVideoSrc} type="video/mp4" />
</video>
{!isBigPhoneView && (
<video
className="landing-video-section__video"
autoPlay
loop
muted
playsInline
poster={landingVideoPosterSrc}
preload="auto"
>
<source src={landingVideoSrc} type="video/mp4" />
</video>
)}
</div>
<div className="landing-video-section__main-info">
<h1 className="landing-video-section__main-info-title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ $viewport-breakpoint: 1000px;

.landing-video-section {
position: relative;

@include big-phone {
background-image: url("/assets/images/landing-mobile-poster.jpg");
background-size: cover;
background-position: center;
height: 37.125rem;
}
}

.landing-video-section__video-wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,6 @@
}
}

.editProfileButton {
--btn-h: 1.5rem;
--btn-pl: 0.25rem;
--btn-pr: 0.25rem;

margin-top: 0.25rem;
font-weight: 500;
}

.userPhoto {
width: 6.25rem;
height: 6.25rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,23 +289,11 @@ const UserDetails: ForwardRefRenderFunction<
/>
</div>
{!isEditing && (
<>
<UserDetailsPreview
className={styles.userDetailsPreview}
user={user}
isMobileView={isMobileView}
/>
{isMobileView && (
<Button
className={styles.editProfileButton}
variant={ButtonVariant.LightPink}
size={ButtonSize.Xsmall}
onClick={onEdit}
>
Edit profile
</Button>
)}
</>
<UserDetailsPreview
className={styles.userDetailsPreview}
user={user}
isMobileView={isMobileView}
/>
)}
</div>
{!isEditing && user.intro && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, { useCallback } from "react";
import { useSelector } from "react-redux";
import { Formik, FormikConfig } from "formik";
import { Button } from "@/shared/components";
import { Form, TextField, LinksArray } from "@/shared/components/Form/Formik";
import { ScreenSize, MAX_LINK_TITLE_LENGTH } from "@/shared/constants";
import { MAX_LINK_TITLE_LENGTH } from "@/shared/constants";
import { CommonLink } from "@/shared/models";
import { getScreenSize } from "@/shared/store/selectors";
import { Button, ButtonVariant } from "@/shared/ui-kit";
import { parseLinksForSubmission } from "@/shared/utils";
import { IStageProps } from "./MembershipRequestModal";
import { MembershipRequestStage } from "./constants";
Expand All @@ -25,8 +23,6 @@ const getInitialValues = (data: IStageProps["userData"]): FormValues => ({

export default function MembershipRequestIntroduce(props: IStageProps) {
const { userData, setUserData, governance } = props;
const screenSize = useSelector(getScreenSize());
const isMobileView = screenSize === ScreenSize.Mobile;

const handleSubmit = useCallback<FormikConfig<FormValues>["onSubmit"]>(
(values) => {
Expand Down Expand Up @@ -95,7 +91,7 @@ export default function MembershipRequestIntroduce(props: IStageProps) {
className="membership-request-introduce__submit-button"
type="submit"
disabled={!isValid}
shouldUseFullWidth={isMobileView}
variant={ButtonVariant.PrimaryPink}
>
Continue
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export default function CreateCommonModal(props: CreateCommonModalProps) {
image: createdCommonData.common.image,
name: createdCommonData.common.name,
directParent: createdCommonData.common.directParent,
rootCommonId: createdCommonData.common.rootCommonId,
hasMembership: true,
hasPermissionToAddProject,
notificationsAmount: 0,
Expand Down
82 changes: 56 additions & 26 deletions src/pages/common/components/ChatComponent/ChatComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useDispatch, useSelector } from "react-redux";
import { useDebounce, useMeasure } from "react-use";
import classNames from "classnames";
import isHotkey from "is-hotkey";
import { delay, omit } from "lodash";
import { debounce, delay, omit } from "lodash";
import { v4 as uuidv4 } from "uuid";
import { selectUser } from "@/pages/Auth/store/selectors";
import { ChatService, DiscussionMessageService, FileService } from "@/services";
Expand Down Expand Up @@ -59,6 +59,7 @@ import {
selectFilesPreview,
FileInfo,
} from "@/store/states";
import { ChatContentContext, ChatContentData } from "../CommonContent/context";
import {
ChatContent,
ChatContentRef,
Expand Down Expand Up @@ -181,6 +182,15 @@ export default function ChatComponent({
const chatContentRef = useRef<ChatContentRef>(null);
const chatWrapperId = useMemo(() => `chat-wrapper-${uuidv4()}`, []);
const chatInputWrapperRef = useRef<HTMLDivElement>(null);
const chatContainerRef = useRef<HTMLDivElement>(null);
const [isScrolling, setScrolling] = useState(false);
const chatContentContextValue: ChatContentData = useMemo(
() => ({
isScrolling,
chatContentRect: chatContainerRef.current?.getBoundingClientRect(),
}),
[isScrolling],
);

const [message, setMessage] = useState<TextEditorValue>(
parseStringToTextEditorValue(),
Expand Down Expand Up @@ -591,6 +601,23 @@ export default function ChatComponent({
};
}, []);

useEffect(() => {
const deactivateScrollingFlag = debounce(() => {
setScrolling(false);
}, 300);

function handleScroll() {
setScrolling(true);
deactivateScrollingFlag();
}

chatContainerRef.current?.addEventListener("scroll", handleScroll);

return () => {
chatContainerRef.current?.removeEventListener("scroll", handleScroll);
};
}, []);

const renderChatInput = (): ReactNode => {
const shouldHideChatInput = !isChatChannel && (!hasAccess || isHidden);

Expand Down Expand Up @@ -666,32 +693,35 @@ export default function ChatComponent({
[styles.emptyChat]: !dateList.length,
})}
id={chatWrapperId}
ref={chatContainerRef}
>
<ChatContent
ref={chatContentRef}
type={type}
commonMember={commonMember}
governanceCircles={governanceCircles}
chatWrapperId={chatWrapperId}
messages={messages}
dateList={dateList}
lastSeenItem={lastSeenItem}
hasPermissionToHide={hasPermissionToHide}
users={users}
discussionId={discussionId}
feedItemId={feedItemId}
isLoading={!discussion || isLoadingDiscussionMessages}
onMessageDelete={handleMessageDelete}
directParent={directParent}
onUserClick={onUserClick}
onFeedItemClick={onFeedItemClick}
onInternalLinkClick={onInternalLinkClick}
isEmpty={
discussionMessagesData.fetched &&
!discussionMessagesData.data?.length && // for non direct messages chats. not using messageCount because it includes the deleted messages as well.
Object.keys(discussionMessages).length === 0 // for direct messages chats
}
/>
<ChatContentContext.Provider value={chatContentContextValue}>
<ChatContent
ref={chatContentRef}
type={type}
commonMember={commonMember}
governanceCircles={governanceCircles}
chatWrapperId={chatWrapperId}
messages={messages}
dateList={dateList}
lastSeenItem={lastSeenItem}
hasPermissionToHide={hasPermissionToHide}
users={users}
discussionId={discussionId}
feedItemId={feedItemId}
isLoading={!discussion || isLoadingDiscussionMessages}
onMessageDelete={handleMessageDelete}
directParent={directParent}
onUserClick={onUserClick}
onFeedItemClick={onFeedItemClick}
onInternalLinkClick={onInternalLinkClick}
isEmpty={
discussionMessagesData.fetched &&
!discussionMessagesData.data?.length && // for non direct messages chats. not using messageCount because it includes the deleted messages as well.
Object.keys(discussionMessages).length === 0 // for direct messages chats
}
/>
</ChatContentContext.Provider>
</div>
<div className={styles.bottomChatContainer}>
<MessageReply users={users} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,6 @@ const ChatContent: ForwardRefRenderFunction<
[chatWrapperId],
);

const scrollMore = useCallback(
(toY: number) =>
setTimeout(
() =>
animateScroll.scrollMore(toY, {
containerId: chatWrapperId,
smooth: true,
delay: 0,
}),
0,
),
[chatWrapperId],
);

const dateListReverse = useMemo(() => [...dateList].reverse(), [dateList]);

useEffect(() => {
Expand Down Expand Up @@ -241,17 +227,6 @@ const ChatContent: ForwardRefRenderFunction<
scrollToRepliedMessage={scrollToRepliedMessage}
highlighted={message.id === highlightedMessageId}
hasPermissionToHide={hasPermissionToHide}
onMessageDropdownOpen={(isOpen, messageTopPosition = 0) => {
const dropdownHeight = 240;
const visibleDropdownHeight =
window.innerHeight - messageTopPosition;
const hasEnoughSpaceForMenu =
visibleDropdownHeight >= dropdownHeight;

if (isOpen && !hasEnoughSpaceForMenu) {
scrollMore(dropdownHeight - visibleDropdownHeight + 20);
}
}}
users={users}
feedItemId={feedItemId}
commonMember={commonMember}
Expand Down
13 changes: 13 additions & 0 deletions src/pages/common/components/CommonContent/context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { useContext } from "react";

export interface ChatContentData {
isScrolling: boolean;
chatContentRect?: DOMRect;
}

export const ChatContentContext = React.createContext<ChatContentData>({
isScrolling: false,
});

export const useChatContentContext = (): ChatContentData =>
useContext(ChatContentContext);
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
@import "../../../../../../../../../../styles/sizes";

.joinButton {
max-width: 8.5rem;
margin-top: 1.75rem;
padding: 0 0.875rem;
width: 100%;

@include tablet {
margin-top: 1.625rem;
Expand Down
Loading