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

Development #207

Closed
wants to merge 112 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
6a04bc2
create simple layout
Aug 29, 2023
e598daa
update color palette
Aug 31, 2023
9ddac2d
create tcTitle component
Aug 31, 2023
68482a3
add document to tcTitle component
Aug 31, 2023
ecd1205
implement components for Account activity parts
Sep 1, 2023
f3cd1d8
add document
Sep 1, 2023
04d7097
add yourAccountActivity part components
Sep 1, 2023
1d5a211
add Audience response components part
Sep 1, 2023
f443d82
remove some code
Sep 1, 2023
612bf78
create engagment component
Sep 4, 2023
160f01c
add vote feature components
Sep 5, 2023
5c315ff
add route to menu
Sep 5, 2023
a176a06
add engagement components
Sep 6, 2023
0eecf52
update components
Sep 6, 2023
6ff1dac
make components responsive
Sep 6, 2023
fb52f94
complete ui
Sep 6, 2023
4f426a9
add style
Sep 6, 2023
b5bea31
change directory of shared components
Sep 15, 2023
80352c1
integrate auth
Sep 26, 2023
10a5a02
add apies
Sep 26, 2023
64755c3
update growth page and change apies
Sep 27, 2023
bb9adab
integrate UI with apies
Sep 27, 2023
2051448
update connected twitter
Sep 27, 2023
b3d7543
update unit tests
Sep 27, 2023
7af2d52
update twitter components and integration
Oct 2, 2023
345aed8
add inprogress field to twitter connected account for status
Oct 2, 2023
97392c1
Merge pull request #193 from TogetherCrew/feat/twitter
mehdi-torabiv Oct 2, 2023
1fb3994
fix button sizes
Oct 3, 2023
8674dd4
fix issue on update twitter status
Oct 3, 2023
32ee1c4
Merge pull request #200 from TogetherCrew/fix/twitter-integration
mehdi-torabiv Oct 3, 2023
31aea1c
fix loading page issue
Oct 3, 2023
dd1d950
Merge pull request #201 from TogetherCrew/fix/twitter-growth-loading
mehdi-torabiv Oct 3, 2023
2b33508
fix button size
Oct 7, 2023
157780d
Merge pull request #202 from TogetherCrew/fix/export-button-style
mehdi-torabiv Oct 7, 2023
da79071
add components for centric pages
Sep 18, 2023
c2b7707
add some component for select community page
Sep 18, 2023
19e40da
create create-new-community page and update node modules
Sep 18, 2023
2fd68d0
change the color
Sep 18, 2023
53b2fe9
implement community-settings page
Sep 20, 2023
e813e83
change variant
Sep 20, 2023
2940fea
create prompt component
Sep 20, 2023
f6a021a
responsive centric pages
Sep 20, 2023
bb93fe4
remove query from router.push
Sep 21, 2023
364aba3
add dialog component for integration on community-settings page
Sep 21, 2023
2f21cfa
update components
Oct 19, 2023
e838b71
create centric slice and integrate first api
Oct 19, 2023
cef4595
update callback funtion & axiosInstance
Oct 22, 2023
0837ba2
integrate community centric pages
Oct 22, 2023
bdba06b
update community centric select community
Oct 23, 2023
a41e341
comment codes relate to old structure
Oct 23, 2023
eb73e33
connect existing api for platforms
Oct 24, 2023
3d3aceb
add disable props to buttons
Oct 24, 2023
2139aad
fix issue on centric pages
Nov 2, 2023
0f2f7d2
integrate community settings integrated platforms parts
Nov 2, 2023
d067d4d
change some texts
Nov 2, 2023
cf78889
update community-settings components
Nov 5, 2023
31d7610
change some texts based on figma design
Nov 5, 2023
a7c66f3
add loading
Nov 9, 2023
0366eea
implement tc-select component
Nov 13, 2023
7537fab
implement popover component
Nov 13, 2023
5b18a33
implement autocomplete components
Nov 13, 2023
9a8df4e
add filter components
Nov 15, 2023
074411d
implement context for token and update privateRoute
Nov 21, 2023
5a544d3
update context
Nov 21, 2023
26e4c86
complete integration for community-settings
Nov 27, 2023
703947c
fix some issue on community platforms
Nov 27, 2023
a28ab4d
replace community input to community-settings page
Nov 28, 2023
fd9543d
add snackbar context and use
Nov 28, 2023
9604523
change some main files
Nov 28, 2023
a7bcb01
add breadcrumbs component
Nov 28, 2023
1ad4440
update tcperiodrange component
Nov 28, 2023
16afae8
add style
Nov 28, 2023
b4d876a
integrate member interaction
Nov 28, 2023
710d3b7
update metrics apies
Nov 28, 2023
401bc52
remove useless imports
Nov 28, 2023
3660423
update channelContext and update platform components integration
Nov 29, 2023
848c9d5
refactor heatmap
Nov 29, 2023
eed35d3
complete responsive size
Nov 29, 2023
8b53776
update community settings pages
Nov 30, 2023
19b6985
remove old routes
Nov 30, 2023
26bdd53
fix updating heatmap data
Nov 30, 2023
70894b3
replace switch-community with select-community routes
Nov 30, 2023
c91316a
fix unit test issue
Nov 30, 2023
6c9cf72
comment autocomplete component
Nov 30, 2023
1815309
remove useless component
Nov 30, 2023
e039aa2
revert changes on sentry.edge
Nov 30, 2023
82d4dc3
fix issue during last debug
Dec 1, 2023
a80c585
update unit tests
Dec 1, 2023
ffabb85
add empty state for statistic
Dec 1, 2023
1f1293c
update community interface and use based on API changes
Dec 3, 2023
b874629
check id for getting platformId
Dec 3, 2023
9efb0a5
Merge pull request #206 from TogetherCrew/feat/organization-centric-app
mehdi-torabiv Dec 4, 2023
1c389b3
add role pagination component
Dec 5, 2023
7e2851c
fix initial state error
Dec 5, 2023
7571ef6
add style
Dec 5, 2023
591f794
Merge pull request #208 from TogetherCrew/feat/role-pagination-component
mehdi-torabiv Dec 5, 2023
3ae63a9
fix style issue on TcPeriodRange
Dec 5, 2023
0e7d527
Merge pull request #209 from TogetherCrew/fix/style-issue
mehdi-torabiv Dec 5, 2023
f616470
fix tooltip on mobile version
Dec 6, 2023
0ed88c1
Merge pull request #211 from TogetherCrew/fix/tooltip-mobile-version
mehdi-torabiv Dec 6, 2023
1ebfb1f
assign avatar community platform to community avatar
Dec 6, 2023
72cf46a
update sidebar and community name avatar components
Dec 6, 2023
f3e8eac
update statement
Dec 7, 2023
35d4e1a
set interval to call channels api every 5 sec
Dec 7, 2023
25a1c9d
add ability to disable channels that we don not have access
Dec 7, 2023
86163f8
fix key issue on customtable
Dec 7, 2023
39de112
fix role filter issues
Dec 8, 2023
f8374fd
fix create new community issue
Dec 8, 2023
110210d
update 404 page
Dec 8, 2023
b970036
improve tcplatformchannel list compoennt
Dec 8, 2023
590bb3c
change component for list of roles
Dec 8, 2023
29b8e22
Merge pull request #213 from TogetherCrew/feat/cc-improvments
mehdi-torabiv Dec 8, 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
Prev Previous commit
Next Next commit
create prompt component
zuies committed Oct 19, 2023
commit 2940feaa3fb927df23751dd2c20fccba1627cb64
194 changes: 194 additions & 0 deletions src/components/layouts/shared/TcPrompt.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
import React, { useState } from 'react';
import { IoCloseSharp } from 'react-icons/io5';
import TcAlert from '../../shared/TcAlert';
import TcButton from '../../shared/TcButton';
import TcCollapse from '../../shared/TcCollapse';
import TcDialog from '../../shared/TcDialog';
import TcLink from '../../shared/TcLink';
import TcText from '../../shared/TcText';
import { useRouter } from 'next/router';

function TcPrompt() {
const router = useRouter();
const currentRoute = router.pathname;
const routesToShow = ['/growth', '/community-settings'];

const [openDialog, setOpenDialog] = useState<boolean>(false);

if (!routesToShow.some((route) => currentRoute.includes(route)))
return (
<>
<TcCollapse
in={true}
sx={{
position: 'sticky',
top: 0,
zIndex: 999,
'&:MuiPaper-root': {
display: 'flex',
justifyContent: 'center',
},
}}
children={
<TcAlert
variant="filled"
className="bg-orange"
icon={false}
sx={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
paddingY: 0,
}}
>
<div className="md:space-x-3 flex flex-col md:flex-row items-center justify-center p-0">
<TcText
text="To see the data, connect your community platforms."
color={'white'}
variant={'subtitle1'}
/>
<TcButton
text={'Connect Community'}
size="small"
variant="outlined"
onClick={() => router.push('/community-settings')}
sx={{
border: '1px solid white',
color: 'white',
paddingY: '0',
'&:hover': {
background: 'white',
border: '1px solid white',
color: 'black',
},
}}
/>
</div>
</TcAlert>
}
/>
<TcDialog
open={openDialog}
fullScreen={false}
sx={{
'& .MuiDialog-container': {
'& .MuiPaper-root': {
width: '100%',
maxWidth: '580px',
borderRadius: '10px',
},
},
}}
>
<div className="block p-2">
<IoCloseSharp
size={36}
onClick={() => setOpenDialog(false)}
className="float-right cursor-pointer"
/>
</div>
<div className="md:w-5/6 mx-auto px-6 md:px-8 pb-8 space-y-4">
<TcText
text={'How to connect your community’s Twitter account'}
variant="h6"
fontWeight="extraBold"
className="text-left md:text-center"
/>
<ol className="space-y-5">
<li>
<TcText
text={
<p>
1 / Go to{' '}
<TcLink
className="text-secondary underline cursor-pointer font-bold"
to={'https://twitter.com/home?lang=en'}
target="_blank"
>
Twitter
</TcLink>
. Ensure you’re connected with your{' '}
<b>community’s Twitter account</b> and leave this window
open.
</p>
}
variant={'body2'}
/>
</li>
<li>
<TcText
text={
<p>
2 / Once you are connected, click on the button below
“Connect Twitter account” and approve the access.
</p>
}
variant={'body2'}
/>
</li>
</ol>
<div className="flex justify-center py-4">
<TcButton text={'Connect Twitter account'} variant="contained" />
</div>{' '}
</div>
</TcDialog>
</>
);
else if (currentRoute === '/growth')
return (
<TcCollapse
in={true}
sx={{
position: 'sticky',
top: 0,
zIndex: 999,
'&:MuiPaper-root': {
display: 'flex',
justifyContent: 'center',
},
}}
children={
<TcAlert
variant="filled"
className="bg-secondary"
icon={false}
sx={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
paddingY: 0,
}}
>
<div className="md:space-x-3 flex flex-col md:flex-row items-center justify-center p-0">
<TcText
text={
'To see the data, connect your community’s Twitter account'
}
color={'white'}
variant={'subtitle1'}
/>
<TcButton
text={'Connect Twitter account'}
size="small"
variant="outlined"
onClick={() => setOpenDialog(true)}
sx={{
border: '1px solid white',
color: 'white',
paddingY: '0',
'&:hover': {
background: 'white',
border: '1px solid white',
color: 'black',
},
}}
/>
</div>
</TcAlert>
}
/>
);
else return null;
}

export default TcPrompt;
153 changes: 3 additions & 150 deletions src/layouts/defaultLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect } from 'react';
import Sidebar from '../components/layouts/Sidebar';
import SidebarXs from '../components/layouts/xs/SidebarXs';
import useAppStore from '../store/useStore';
import { StorageService } from '../services/StorageService';
import { IUser } from '../utils/types';
import TcAlert from '../components/shared/TcAlert';
import TcButton from '../components/shared/TcButton';
import TcCollapse from '../components/shared/TcCollapse';
import TcText from '../components/shared/TcText';
import TcDialog from '../components/shared/TcDialog';
import { IoCloseSharp } from 'react-icons/io5';
import TcLink from '../components/shared/TcLink';
import { useRouter } from 'next/router';
import jwt_decode from 'jwt-decode';
import { IDecodedToken } from '../utils/interfaces';
import { decodeUserTokenDiscordId } from '../helpers/helper';
import TcPrompt from '../components/layouts/shared/TcPrompt';

type IDefaultLayoutProps = {
children: React.ReactNode;
};

export const defaultLayout = ({ children }: IDefaultLayoutProps) => {
const router = useRouter();
const currentRoute = router.pathname;

const { getGuilds, getGuildInfoByDiscord, authorizeTwitter, getUserInfo } =
useAppStore();
const [openDialog, setOpenDialog] = useState<boolean>(false);

const user = StorageService.readLocalStorage<IUser>('user');

@@ -65,142 +51,9 @@ export const defaultLayout = ({ children }: IDefaultLayoutProps) => {
}
}, []);

const handleAuthorizeTwitter = () => {
authorizeTwitter(decodeUserTokenDiscordId(user));
};

const isAllTwitterPropertiesNull =
user &&
user.twitter &&
Object.values(user.twitter).every((value) => value == null);

return (
<>
{currentRoute === '/growth' && isAllTwitterPropertiesNull && (
<>
<TcCollapse
in={true}
sx={{
position: 'sticky',
top: 0,
zIndex: 999,
'&:MuiPaper-root': {
display: 'flex',
justifyContent: 'center',
},
}}
children={
<TcAlert
variant="filled"
className="bg-secondary"
icon={false}
sx={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
paddingY: 0,
}}
>
<div className="md:space-x-3 flex flex-col md:flex-row items-center justify-center p-0">
<TcText
text={
'To see the data, connect your community’s Twitter account'
}
color={'white'}
variant={'subtitle1'}
/>
<TcButton
text={'Connect Twitter account'}
size="small"
variant="outlined"
onClick={() => setOpenDialog(true)}
sx={{
border: '1px solid white',
color: 'white',
paddingY: '0',
'&:hover': {
background: 'white',
border: '1px solid white',
color: 'black',
},
}}
/>
</div>
</TcAlert>
}
/>
<TcDialog
open={openDialog}
fullScreen={false}
sx={{
'& .MuiDialog-container': {
'& .MuiPaper-root': {
width: '100%',
maxWidth: '580px',
borderRadius: '10px',
},
},
}}
>
<div className="block p-2">
<IoCloseSharp
size={36}
onClick={() => setOpenDialog(false)}
className="float-right cursor-pointer"
/>
</div>
<div className="md:w-5/6 mx-auto px-6 md:px-8 pb-8 space-y-4">
<TcText
text={'How to connect your community’s Twitter account'}
variant="h6"
fontWeight="extraBold"
className="text-left md:text-center"
/>
<ol className="space-y-5">
<li>
<TcText
text={
<p>
1 / Go to{' '}
<TcLink
className="text-secondary underline cursor-pointer font-bold"
to={'https://twitter.com/home?lang=en'}
target="_blank"
>
Twitter
</TcLink>
. Ensure you’re connected with your{' '}
<b>community’s Twitter account</b> and leave this window
open.
</p>
}
variant={'body2'}
/>
</li>
<li>
<TcText
text={
<p>
2 / Once you are connected, click on the button below
“Connect Twitter account” and approve the access.
</p>
}
variant={'body2'}
/>
</li>
</ol>
<div className="flex justify-center py-4">
<TcButton
text={'Connect Twitter account'}
variant="contained"
onClick={() => handleAuthorizeTwitter()}
/>
</div>
</div>
</TcDialog>
</>
)}

<TcPrompt />
<div className="flex flex-col md:flex-row justify-between w-full">
<Sidebar />
<SidebarXs />
2 changes: 2 additions & 0 deletions src/pages/centric/create-new-community.tsx
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import TcCheckbox from '../../components/shared/TcCheckbox';
import { FormControlLabel } from '@mui/material';
import TcLink from '../../components/shared/TcLink';
import TcButton from '../../components/shared/TcButton';
import router from 'next/router';

function CreateNewCommunity() {
return (
@@ -61,6 +62,7 @@ function CreateNewCommunity() {
text="Create community"
variant="contained"
color="secondary"
onClick={() => router.push('/?connectedCommunity=false')}
/>
</div>
</div>