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

Channels listing and details page #1861

Merged
merged 56 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
4d9e9bd
in progress
rohitmalhotra1420 Sep 13, 2024
1fe852e
added listing api
mishramonalisha76 Sep 17, 2024
e28ef6d
Ui in progress
rohitmalhotra1420 Sep 17, 2024
cf93727
Merge branch 'DAPP-1856-channel-detail' of github.com:push-protocol/p…
rohitmalhotra1420 Sep 17, 2024
43903df
fixed type
mishramonalisha76 Sep 17, 2024
bd1933f
implemented listing
rohitmalhotra1420 Sep 17, 2024
049a95d
Merge branch 'DAPP-1856-channel-detail' of github.com:push-protocol/p…
rohitmalhotra1420 Sep 17, 2024
9e56995
shifted to api call for channel list
mishramonalisha76 Sep 17, 2024
343bee5
api fixes
rohitmalhotra1420 Sep 17, 2024
61143f3
Merge branch 'DAPP-1856-channel-detail' of github.com:push-protocol/p…
rohitmalhotra1420 Sep 17, 2024
c367239
fixed the ui of card and category
rohitmalhotra1420 Sep 17, 2024
4887b9f
fixed param type
rohitmalhotra1420 Sep 17, 2024
a859134
added fixed
mishramonalisha76 Sep 18, 2024
1328eb1
added sdk channel list call
mishramonalisha76 Sep 18, 2024
840b926
scroll implemented
rohitmalhotra1420 Sep 18, 2024
3158bfa
Merge branch 'DAPP-1856-channel-detail' of github.com:push-protocol/p…
rohitmalhotra1420 Sep 18, 2024
02f5370
fixed the pagination for channel list
rohitmalhotra1420 Sep 18, 2024
f609ed9
added listing and search
rohitmalhotra1420 Sep 19, 2024
b71bb22
added preview
mishramonalisha76 Sep 19, 2024
e7e847d
fixed the layout
rohitmalhotra1420 Sep 20, 2024
0e20995
channel details page
mishramonalisha76 Sep 20, 2024
efb9596
added responsiveness support
rohitmalhotra1420 Sep 20, 2024
834cbec
pulled changes
mishramonalisha76 Sep 20, 2024
2a1d962
Merge branch 'DApp-1854-channel-listing' of github.com:ethereum-push-…
mishramonalisha76 Sep 20, 2024
e54b77e
added layout variant
mishramonalisha76 Sep 20, 2024
8be394e
Update App.tsx
mishramonalisha76 Sep 20, 2024
a420b0d
fixed category scroll (#1862)
rohitmalhotra1420 Sep 20, 2024
33cbca5
added layout variant
mishramonalisha76 Sep 20, 2024
20e191c
Merge branch 'DAPP-1856-channel-detail' of github.com:ethereum-push-n…
mishramonalisha76 Sep 20, 2024
eab317f
fixed review comments
mishramonalisha76 Sep 20, 2024
abc2e4d
fixed review comments
mishramonalisha76 Sep 23, 2024
f1ce738
channel category implemented
rohitmalhotra1420 Sep 24, 2024
1c60539
Merge branch 'DAPP-1856-channel-detail' of github.com:push-protocol/p…
rohitmalhotra1420 Sep 24, 2024
716afb9
filters implmented
rohitmalhotra1420 Sep 24, 2024
e2221db
channels listing page done
rohitmalhotra1420 Sep 25, 2024
a929b34
debug turned off
rohitmalhotra1420 Sep 25, 2024
43e9fc5
fixed review comments
mishramonalisha76 Sep 25, 2024
59f48c9
added null state
rohitmalhotra1420 Sep 25, 2024
ce15059
Merge branch 'DAPP-1856-channel-detail' of github.com:push-protocol/p…
rohitmalhotra1420 Sep 25, 2024
55e2f58
fixed channel search hook
rohitmalhotra1420 Sep 26, 2024
f6755e2
PR fixes done
rohitmalhotra1420 Sep 26, 2024
d56e045
fixed the edit channel for category
rohitmalhotra1420 Sep 26, 2024
46dabff
fixed channel list search query
rohitmalhotra1420 Sep 26, 2024
6158fd8
Wrapped channel img in Link
rohitmalhotra1420 Sep 27, 2024
3205b20
menu item label changes
rohitmalhotra1420 Sep 27, 2024
9dad9a6
fixes done
rohitmalhotra1420 Oct 7, 2024
c0de1d2
Merge branch 'main' of github.com:push-protocol/push-dapp into DAPP-1…
rohitmalhotra1420 Oct 9, 2024
bab74a7
channel details card refactor
rohitmalhotra1420 Oct 9, 2024
f5f2385
outline button fix and category scroll fix
rohitmalhotra1420 Oct 9, 2024
41b8086
spacing ui fixes done
rohitmalhotra1420 Oct 10, 2024
f413bf4
category added to channel profile
rohitmalhotra1420 Oct 15, 2024
d6a8b9a
added config channels
mishramonalisha76 Oct 17, 2024
ee5c1e8
added config channels
mishramonalisha76 Oct 17, 2024
0229f91
fixed select
mishramonalisha76 Oct 17, 2024
24e0b56
fixed select
mishramonalisha76 Oct 17, 2024
0d106b1
added review changes
mishramonalisha76 Oct 18, 2024
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
1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ export default function App() {
}, []);

const steps = UserJourneySteps({ darkMode });

const handleJoyrideCallback = (data: CallBackProps) => {
const { action, lifecycle, index } = data;
if (lifecycle === 'ready') {
Expand Down
1 change: 1 addition & 0 deletions src/blocks/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const StyledButton = styled.button<ButtonProps>`
font-family: var(--font-family);
justify-content: center;
white-space: nowrap;
flex-shrink: 0;

/* Common icon css added through CSS class */
.icon {
Expand Down
7 changes: 4 additions & 3 deletions src/blocks/icons/components/CaretLeft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ const CaretLeft: FC<IconProps> = (allProps) => {
componentName="CaretLeft"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
width="inherit"
height="inherit"
viewBox="0 0 6 10"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="M4.89258 8.72499L1.16758 4.99999L4.89258 1.27499"
d="M14.8389 17.5875L9.25137 12L14.8389 6.41248"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
Expand Down
29 changes: 21 additions & 8 deletions src/blocks/icons/components/CaretRight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,32 @@ const CaretRight: FC<IconProps> = (allProps) => {
componentName="CaretRight"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
width="inherit"
height="inherit"
viewBox="0 0 6 10"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="M1.16748 1.27502L4.89246 5L1.16748 8.72498"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
/>
<g clip-path="url(#clip0_4239_16009)">
<path
d="M9.25146 6.41254L14.8389 12L9.25146 17.5875"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_4239_16009">
<rect
width="15.9553"
height="8.72765"
fill="white"
transform="translate(16.4089 4.02235) rotate(90)"
/>
</clipPath>
</defs>
</svg>
}
{...restProps}
Expand Down
3 changes: 1 addition & 2 deletions src/blocks/icons/components/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ const Chat: FC<IconProps> = (allProps) => {
componentName="Chat"
icon={
<svg
width="inherit"
height="inherit"
style={{ width: 'inherit', height: 'inherit' }}
viewBox="0 0 32 32"
fill="none"
xmlns="http://www.w3.org/2000/svg"
Expand Down
37 changes: 37 additions & 0 deletions src/blocks/icons/components/Tutotial.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { FC } from 'react';
import { IconWrapper } from '../IconWrapper';
import { IconProps } from '../Icons.types';

const Tutorial: FC<IconProps> = (allProps) => {
const { svgProps: props, ...restProps } = allProps;
return (
<IconWrapper
componentName="Tutorial"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
style={{ width: 'inherit', height: 'inherit' }}
viewBox="0 0 22 21"
fill="none"
{...props}
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0 2.09998V14.9666C0 16.0712 0.895431 16.9666 2 16.9666H20C21.1046 16.9666 22 16.0712 22 14.9666V2.09998C22 0.995407 21.1046 0.0999756 20 0.0999756H2C0.89543 0.0999756 0 0.995406 0 2.09998ZM8.8 4.31022V12.6964C8.8 12.9192 9.06929 13.0307 9.22678 12.8732L13.7424 8.35756C13.8454 8.25459 13.8389 8.08575 13.7284 7.99097L9.2127 4.12041C9.05053 3.98141 8.8 4.09663 8.8 4.31022Z"
fill="currentColor"
/>
<path
d="M5.8667 19.9H16.1334"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
/>
</svg>
}
{...restProps}
/>
);
};

export default Tutorial;
1 change: 1 addition & 0 deletions src/blocks/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export { default as Swap } from './components/Swap';
export { default as Tick } from './components/Tick';
export { default as TickCircleFilled } from './components/TickCircleFilled';
export { default as TickDecoratedCircleFilled } from './components/TickDecoratedCircleFilled';
export { default as Tutorial } from './components/Tutotial';

export { default as UserFilled } from './components/UserFilled';

Expand Down
1 change: 1 addition & 0 deletions src/blocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export { Menu, type MenuProps, MenuItem, type MenuItemComponentProps } from './m
export { Modal, type ModalProps, modal } from './modal';
export { notification } from './notification';
export { Pagination, type PaginationProps } from './pagination';
export { Pill, type PillProps } from './pill';
export { ProgressBar, type ProgressBarProps } from './progressBar';
export { Separator, type SeparatorProps } from './separator';
export { Skeleton, type SkeletonProps } from './skeleton';
Expand Down
45 changes: 45 additions & 0 deletions src/blocks/pill/Pill.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { FC, ReactNode } from 'react';
import styled, { FlattenSimpleInterpolation } from 'styled-components';
import { TransformedHTMLAttributes } from '../Blocks.types';
import { getTextVariantStyles } from '../Blocks.utils';

export type PillProps = {
/* Child react nodes rendered by Pill */
children?: ReactNode;
/* Additional prop from styled components to apply custom css to Lozenge */
css?: FlattenSimpleInterpolation;
/* Decides the UI state of the component */
isActive?: boolean;
} & TransformedHTMLAttributes<HTMLDivElement>;

const StyledPill = styled.div<PillProps>`
align-items: center;
border-radius: var(--radius-xl);
background: var(--${({ isActive }) => (isActive ? 'surface-primary-inverse' : 'surface-secondary')});
cursor: pointer;
display: flex;
flex-direction: column;
height: 40px;
justify-content: center;
max-width: max-content;
padding: var(--spacing-none) var(--spacing-sm);

${({ isActive }) => getTextVariantStyles('bs-semibold', isActive ? 'text-primary-inverse' : 'text-primary')}

/* Custom CSS applied via styled component css prop */
${(props) => props.css || ''}
`;

const Pill: FC<PillProps> = ({ children, isActive = false, onClick, ...props }) => {
return (
<StyledPill
isActive={isActive}
onClick={onClick}
{...props}
>
{children}
</StyledPill>
);
};

export { Pill };
1 change: 1 addition & 0 deletions src/blocks/pill/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Pill';
9 changes: 6 additions & 3 deletions src/blocks/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ export type SelectProps = {
action?: ReactNode;
};

const Container = styled.div<{ css?: FlattenSimpleInterpolation }>`
const Container = styled.div<{ css?: FlattenSimpleInterpolation; label: SelectProps['label'] }>`
align-items: flex-start;
display: flex;
flex-direction: column;
flex: 1 0 0;
gap: var(--spacing-xxs, 8px);
gap: var(--spacing-${({ label }) => (label ? 'xxs' : 'none')});

/* Custom CSS applied via styled component css prop */
${(props) => props.css || ''};
Expand Down Expand Up @@ -255,7 +255,10 @@ const Select: React.FC<SelectProps> = ({
};

return (
<Container css={css}>
<Container
css={css}
label={label}
>
<LabelContainer>
<LabelText color={disabled ? 'components-inputs-text-disabled' : 'components-inputs-text-default'}>
<LabelTextContainer>
Expand Down
9 changes: 6 additions & 3 deletions src/blocks/textInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export type TextInputProps = {
value: string | number;
};

const Container = styled.div<{ css?: FlattenSimpleInterpolation }>`
const Container = styled.div<{ css?: FlattenSimpleInterpolation; label: TextInputProps['label'] }>`
align-items: flex-start;
display: flex;
flex-direction: column;
flex: 1 0 0;
gap: var(--spacing-xxs, 8px);
gap: var(--spacing-${({ label }) => (label ? 'xxs' : 'none')});

/* Custom CSS applied via styled component css prop */
${(props) => props.css || ''};
Expand Down Expand Up @@ -151,7 +151,10 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(
ref
) => {
return (
<Container css={css}>
<Container
css={css}
label={label}
>
{label && (
<LabelContainer>
<InputText
Expand Down
23 changes: 23 additions & 0 deletions src/common/Common.utils.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { appConfig } from 'config';
import { LOGO_ALIAS_CHAIN } from './Common.constants';
import { networkName } from 'helpers/UtilityHelper';

export const allowedNetworks = appConfig.allowedNetworks.filter(
(chain: number) => chain != appConfig.coreContractChain
);

export const getSelectChains = (chainIdList: Array<number>) => {
return chainIdList?.map((key: number) => {
const Component = LOGO_ALIAS_CHAIN[key];
Expand All @@ -11,3 +16,21 @@ export const getSelectChains = (chainIdList: Array<number>) => {
};
});
};

/**
* @param count
* @returns returns formatted number
*/
export const formatSubscriberCount = (count?: number) => {
if (count) {
if (count >= 1000000) {
return (count / 1000000).toFixed(1) + 'M';
} else if (count >= 1000) {
return (count / 1000).toFixed(1) + 'K';
} else {
return count;
}
} else {
return 0;
}
};
Loading
Loading