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

fix issues #225

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IntegrationPlatform } from '../../../utils/enums';

function TcAvailableIntegrations() {
return (
<div className="flex flex-row space-x-5 overflow-x-scroll py-2">
<div className="flex flex-row space-x-5 overflow-x-scroll md:overflow-x-hidden py-2">
{Object.values(IntegrationPlatform).map((platform, index) => (
<TcAvailableIntegrationsItem
disabled={platform !== 'Discord'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function TcConnectedPlatforms({
connectedPlatforms,
}: IConnectedPlatformsProps) {
return (
<div className="flex flex-row space-x-5 overflow-x-scroll py-2">
<div className="flex flex-row space-x-5 overflow-x-scroll md:overflow-x-hidden py-2">
{connectedPlatforms?.map((platform: IPlatformProps, index: number) => (
<TcConnectedPlatformsItem key={index} platform={platform} />
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ function TcConfirmDeleteCommunity({
<div className="flex flex-col space-y-8 mx-auto text-center justify-center pb-8 px-8">
<TcText
variant="h6"
text={`To confirm that you want to delete the community, please type ${community?.name} in the field below:`}
text={
<>
To confirm that you want to delete the community, please type{' '}
<b>{community?.name}</b> in the field below:
</>
}
/>
<div className="w-2/3 pb-12 text-center mx-auto">
<TcInput
Expand Down
5 changes: 4 additions & 1 deletion src/components/global/FilterPopover/FilterRolesPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ function FilterRolesPopover({ handleSelectedRoles }: IFilterRolesPopover) {

const { retrievePlatformProperties } = useAppStore();
const { community } = useToken();
const platformId = community?.platforms[0]?.id;

const platformId = community?.platforms.find(
(platform) => platform.disconnectedAt === null
)?.id;

const [loading, setLoading] = useState<boolean>(false);

Expand Down
4 changes: 3 additions & 1 deletion src/components/pages/pageIndex/ActiveMemberComposition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const ActiveMemberComposition = () => {
let endDate: moment.Moment = moment().subtract(1, 'day');
let startDate: moment.Moment = moment(endDate).subtract(7, 'days');

const platformId = community?.platforms[0]?.id;
const platformId = community?.platforms.find(
(platform) => platform.disconnectedAt === null
)?.id;

if (platformId) {
fetchActiveMembers(platformId, startDate, endDate);
Expand Down
11 changes: 3 additions & 8 deletions src/components/pages/pageIndex/HeatmapChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import { useToken } from '../../../context/TokenContext';
import { defaultHeatmapChartOptions } from '../../../lib/data/heatmap';
import { ChannelContext } from '../../../context/ChannelContext';
import { extractTrueSubChannelIds } from '../../../helpers/helper';
import { StorageService } from '../../../services/StorageService';
import { IDiscordModifiedCommunity } from '../../../utils/interfaces';
import Loading from '../../global/Loading';

if (typeof Highcharts === 'object') {
Expand Down Expand Up @@ -52,7 +50,9 @@ const HeatmapChart = () => {

const { community } = useToken();

const platformId = community?.platforms[0]?.id;
const platformId = community?.platforms.find(
(platform) => platform.disconnectedAt === null
)?.id;

const fetchData = async () => {
setLoading(true);
Expand Down Expand Up @@ -149,11 +149,6 @@ const HeatmapChart = () => {

const fetchPlatformChannels = async () => {
try {
const community =
StorageService.readLocalStorage<IDiscordModifiedCommunity>('community');

const platformId = community?.platforms[0]?.id;

if (platformId) {
const data = await retrievePlatformById(platformId);
const { metadata } = data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export default function ActiveMemberBreakdown() {
totalPages: 0,
totalResults: 0,
});
const platformId = community?.platforms[0]?.id;

const platformId = community?.platforms.find(
(platform) => platform.disconnectedAt === null
)?.id;

const handlePageChange = (selectedPage: number) => {
setPage(selectedPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export default function DisengagedMembersCompositionBreakdown() {
totalResults: 0,
});

const platformId = community?.platforms[0]?.id;
const platformId = community?.platforms.find(
(platform) => platform.disconnectedAt === null
)?.id;

const handlePageChange = (selectedPage: number) => {
setPage(selectedPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export default function OnboardingMembersBreakdown() {
totalResults: 0,
});

const platformId = community?.platforms[0]?.id;
const platformId = community?.platforms.find(
(platform) => platform.disconnectedAt === null
)?.id;

const handlePageChange = (selectedPage: number) => {
setPage(selectedPage);
Expand Down
4 changes: 3 additions & 1 deletion src/pages/community-health.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ function CommunityHealth() {
useState<IFragmentationScoreResponse | null>(null);

useEffect(() => {
const platformId = community?.platforms[0]?.id;
const platformId = community?.platforms.find(
(platform) => platform.disconnectedAt === null
)?.id;

if (platformId) {
Promise.all([
Expand Down
4 changes: 3 additions & 1 deletion src/pages/membersInteraction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export default function membersInteraction() {
const { getMemberInteraction, isLoading } = useAppStore();

useEffect(() => {
const platformId = community?.platforms[0]?.id;
const platformId = community?.platforms.find(
(platform) => platform.disconnectedAt === null
)?.id;

if (platformId) {
getMemberInteraction(platformId).then((apiResponse: any[]) => {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import Image from 'next/image';

const Statistics = () => {
const { community } = useToken();
const platformId = community?.platforms[0]?.id;
const platformId = community?.platforms.find(
(platform) => platform.disconnectedAt === null
)?.id;

const [loading, setLoading] = useState<boolean>(true);
const [activeMemberDate, setActiveMemberDate] = useState(1);
Expand Down
Loading