Skip to content

Commit

Permalink
Merge pull request #2964 from Giveth/develop
Browse files Browse the repository at this point in the history
Hotifx on sorting for QF
  • Loading branch information
mateodaza authored Jul 21, 2023
2 parents 2105657 + e42ee70 commit d4cb098
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "givethdapp",
"version": "2.17.1",
"version": "2.17.2",
"private": true,
"scripts": {
"build": "next build",
Expand Down
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const HOME_QUERY_VARIABLES = {
skipLatestUpdates: 0,
fromDate: '2021-01-01',
limit: 12,
sortingBy: EProjectsSortBy.GIVPOWER,
sortingBy: EProjectsSortBy.INSTANT_BOOSTING,
};

const HomeRoute = (props: IHomeRoute) => {
Expand Down
2 changes: 1 addition & 1 deletion pages/qf/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const QF_PROJECTS = {
variables: {
limit: 15,
skip: 0,
sortingBy: EProjectsSortBy.GIVPOWER,
sortingBy: EProjectsSortBy.INSTANT_BOOSTING,
filters: [EProjectsFilter.ACTIVE_QF_ROUND],
},
notifyOnNetworkStatusChange: true,
Expand Down
2 changes: 1 addition & 1 deletion src/apollo/gql/gqlOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const OPTIONS_HOME_PROJECTS = {
variables: {
limit: 15,
skip: 0,
sortingBy: EProjectsSortBy.GIVPOWER,
sortingBy: EProjectsSortBy.INSTANT_BOOSTING,
},
notifyOnNetworkStatusChange: true,
};
3 changes: 3 additions & 0 deletions src/components/views/donate/QFToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ import InternalLink from '@/components/InternalLink';
const QFToast = () => {
const { info } = usePassport();
const { passportState, currentRound } = info;

const isEligible = passportState === EPassportState.ELIGIBLE;
const isNotEligible = passportState === EPassportState.NOT_ELIGIBLE;
const { formatMessage, locale } = useIntl();

if (passportState === EPassportState.LOADING) return null;

const color = isEligible
? semanticColors.jade['500']
: semanticColors.golden['700'];
Expand Down
8 changes: 7 additions & 1 deletion src/components/views/donate/SuccessView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import LottieControl from '@/components/LottieControl';
import { EContentType } from '@/lib/constants/shareContent';
import QFToast from '@/components/views/donate/QFToast';
import { useAppSelector } from '@/features/hooks';
import { EPassportState, usePassport } from '@/hooks/usePassport';

const SuccessView: FC = () => {
const { formatMessage } = useIntl();
Expand All @@ -34,6 +35,9 @@ const SuccessView: FC = () => {

const [givethSlug, setGivethSlug] = useState<string>('');
const { project } = useDonateData();
const {
info: { passportState },
} = usePassport();

const message = hasMultipleTxs ? (
<>
Expand Down Expand Up @@ -95,7 +99,9 @@ const SuccessView: FC = () => {
</ExternalLink>
</GivBackContainer>
)}
{hasActiveQFRound && <QFToast />}
{hasActiveQFRound && passportState !== EPassportState.LOADING && (
<QFToast />
)}
<SocialBoxWrapper>
<SocialBox
project={project}
Expand Down
11 changes: 6 additions & 5 deletions src/components/views/projects/ProjectsSortSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
P,
IconFast16,
IconFlash16,
IconRocketInSpace16,
} from '@giveth/ui-design-system';
import Select, {
components,
Expand Down Expand Up @@ -43,11 +44,11 @@ const ProjectsSortSelect = () => {
const { formatMessage } = useIntl();

const sortByOptions = [
// {
// label: formatMessage({ id: 'label.givpower' }),
// value: EProjectsSortBy.INSTANT_BOOSTING,
// icon: <IconRocketInSpace16 color={brandColors.deep[900]} />,
// },
{
label: formatMessage({ id: 'label.givpower' }),
value: EProjectsSortBy.INSTANT_BOOSTING,
icon: <IconRocketInSpace16 color={brandColors.deep[900]} />,
},
{
label: formatMessage({ id: 'label.rank' }),
value: EProjectsSortBy.GIVPOWER,
Expand Down
6 changes: 3 additions & 3 deletions src/context/projects.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ interface IProjectsContext {
}

const variablesDefaultValue = {
sortingBy: EProjectsSortBy.GIVPOWER,
sortingBy: EProjectsSortBy.INSTANT_BOOSTING,
filters: undefined,
};

const variablesDefaultValueWithQF = {
sortingBy: EProjectsSortBy.GIVPOWER,
sortingBy: EProjectsSortBy.INSTANT_BOOSTING,
filters: [EProjectsFilter.ACTIVE_QF_ROUND],
};

Expand Down Expand Up @@ -65,7 +65,7 @@ export const ProjectsProvider = (props: {
const router = useRouter();

useEffect(() => {
let sort = EProjectsSortBy.GIVPOWER;
let sort = EProjectsSortBy.INSTANT_BOOSTING;
if (router.query.sort) {
switch ((router.query.sort as string).toLowerCase()) {
case EProjectsSortBy.MOST_FUNDED.toLowerCase():
Expand Down

1 comment on commit d4cb098

@vercel
Copy link

@vercel vercel bot commented on d4cb098 Jul 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

giveth-dapps-v2 – ./

giveth.io
giveth-dapps-v2-givethio.vercel.app
giveth-dapps-v2-git-main-givethio.vercel.app
www.giveth.io

Please sign in to comment.