diff --git a/lang/ca.json b/lang/ca.json index 3e3643fede..bd8ec3c9ac 100644 --- a/lang/ca.json +++ b/lang/ca.json @@ -9,6 +9,7 @@ "climate-action": "Acció climàtica", "component.already_donated.incorrect_estimate": "Ja has fet una donació a aquest projecte, per tant l'estimació de l'emparellament serà incorrecta.", "component.already_donated.once_more": "Ja has donat! Dona una vegada més", + "component.archived_qf_middle_banner.desc": "Explora les rondes passades de finançament quadràtic a Giveth! Consulta els projectes que hi han participat, els fons de coincidència, les donacions i més informació en aquesta pàgina.", "component.archive_cover.archived": "ARXIVAT", "component.archive_stream_modal.archived_title": "Heu arxivat amb èxit una donació recurrent", "component.archive_stream_modal.confirm_button": "Sí, Arxivar", @@ -143,7 +144,6 @@ "label.all_time_donations_received": "Donacions rebudes de tots els temps", "label.all_time_funding": "Finançament total rebut", "label.all_your_staked_giv_including_the_locked": "Tot el teu GIV en stake, incloent el GIV bloquejat.", - "label.to_know_next_givers_round": "per saber quan succeeix la pròxima ronda de Nominats pels Donants", "label.always": "Sempre", "label.amount": "Import", "label.amount_is_too_small": "L'import és massa petit", @@ -173,6 +173,7 @@ "label.approve_pending": "Aprovació pendent", "label.approving": "Aprovant", "label.archived": "Arxivat", + "label.archived_qf_rounds": "Rondes QF arxivades", "label.archived_rounds": "Rondes arxivades", "label.archive_donation": "Arxivar donació", "label.archive_stream": "Arxiva el Stream", @@ -193,6 +194,7 @@ "label.back_into_the": "de tornada al", "label.balance_runs_out_in": "El saldo s'esgota en", "label.become_a_liquidity_provider": "Converteix-te en un proveïdor de liquiditat i fes stake dels teus tokens a la GIVfarm per generar encara més GIV en recompenses.", + "label.become_project_nominator": "Converteix-te en un Nominador de Projectes", "label.before_you_start": "Abans de començar", "label.better_communicate_with_the_community": "Comunicar-se amb la comunitat.", "label.be_specific_about_your_projects_progress": "Sigues específic sobre el progrés i els objectius del teu projecte i estructura la informació perquè sigui fàcil de llegir, afegint capçaleres i paràgrafs.", @@ -365,6 +367,7 @@ "label.email": "correu electrònic", "label.email_address": "Adreça electrònica", "label.enable_change": "Habilita el canvi", + "label.enable_recurring_donations": "Habilitar Donacions Recurrents", "label.ends_on": "acaba el", "label.end_date": "Data de finalització", "label.end_recurring_donation": "Finalitzar Donació Recurrent", @@ -419,7 +422,6 @@ "label.get_rewarded_for_giving": "Obtén recompenses per donar a projectes de béns públics verificats amb donacions en cripto.", "label.get_started": "Començar", "label.get_your_donations_matched": "Aconsegueix les teves donacions igualades!", - "label.become_project_nominator": "Converteix-te en un Nominador de Projectes", "label.gitcoin_passport": "Gitcoin Passport", "label.git_and_get_giv": "Dona i obtén GIV", "label.givbacks": "GIVbacks", @@ -554,6 +556,7 @@ "label.just_launched": "Acabat de Llançar", "label.just_now": "Ara mateix", "label.keep_an_eye_on_the_projects_page": "Vigila la pàgina de projectes, la seva posició en l'ordenació per defecte canviarà en 5 minuts o menys.", + "label.keep_eye_on_twitter": "Mantingueu un ull al Twitter de Giveth ", "label.keep_it_short_and_impactful": "Mantén-ho breu i impactant: un títol concís captiva l'atenció.", "label.kyc_less_the_service_is_based_in_sw": " sense KYC: el servei està basat a Suïssa i és un intermediari financer autoritzat", "label.last_name": "Cognom", @@ -562,10 +565,10 @@ "label.learn": "Aprendre", "label.learn_how_to_become_an_active_part": "Aprèn com convertir-te en un agent actiu de la nostra xarxa de donacions.", "label.learn_more": "Aprèn-ne més", - "label.learn_more_recurring_donations": "Apreneu més sobre les donacions recurrents a Giveth", "label.learn_more_about": "Aprèn més sobre els beneficis.", "label.learn_more_about_donating_on_giveth": "Aprèn més sobre com donar a Giveth", "label.learn_more_about_giv": "Aprèn més sobre GIV", + "label.learn_more_recurring_donations": "Apreneu més sobre les donacions recurrents a Giveth", "label.learn_the_basics": "Aprèn els conceptes bàsics", "label.leave_feedback": "Deixa una valoració", "label.leave_feedback.caption": "Fes-nos saber com ha estat la teva experiència!\n Com podem millorar?", @@ -577,7 +580,6 @@ "label.liked_projects": "Projectes Favorits", "label.likes": "Favorits", "label.link_to_your_giveth_project": "Enllaç al teu projecte de Giveth a les teves xarxes socials", - "label.project_social_link": "Enllaç Social del Projecte", "label.liquid_giv_that_has_already_flowed": "GIV líquid que ja ha fluït del GIVstream", "label.liquid_reward_token_that_has_flowed": "{rewardTokenSymbol} líquid que ha fluït del {rewardTokenSymbol}stream", "label.listing": "Llistat", @@ -605,9 +607,9 @@ "label.make_your_donation_eligible_for_matching": "Fes la teva donació elegible per a la coincidència", "label.manage_addresses": "Gestiona adreces", "label.manage_recurring_donations": "Gestiona donacions recurrents", - "label.managing_your_recurring_donations": "Gestionant les vostres donacions recurrents", "label.manage_your_givpower": "Administra el teu GIVpower", "label.managing_funds": "Gestió de fons", + "label.managing_your_recurring_donations": "Gestionant les vostres donacions recurrents", "label.mark_all_as_read": "Marcar tot com a llegit", "label.matching": "Emparellament", "label.matching_funds_coming_soon": "Fons d'emparellament disponibles aviat...", @@ -720,7 +722,6 @@ "label.please_do_not_enter_exchange_deposit": "Si us plau, NO introduïu una adreça de dipòsit d'intercanvi, o els vostres fons podrien perdre's! Utilitzeu un compte que controleu en aquesta xarxa. Recomanem utilitzar Metamask.", "label.please_enter_full_link": "Introdueix el vincle complet", "label.please_note_it_will_take_few_minutes_for_your_giv_to_bridge": "Si us plau, tingueu en compte que trigarà uns minuts perquè el vostre GIV es transfereixi.", - "label.project_owner_contact_text": "Proporciona'ns la informació de contacte del propietari del projecte en cas de comunicacions importants, com problemes amb el teu projecte o si es converteix en elegible per a una ronda d'emparellament QF.", "label.please_select_a_category": "Selecciona una categoria, si us plau.", "label.please_select_one_option": "Si us plau selecciona una opció", "label.please_set_a_valid_email": "Si us plau, introdueix una adreça de correu electrònic vàlida!", @@ -754,6 +755,8 @@ "label.project_name": "Nom del projecte", "label.project_not_available": "Vaja! Aquest projecte ja no està disponible o no s'ha trobat!", "label.project_official_name": "Nom oficial del projecte", + "label.project_owner_contact_text": "Proporciona'ns la informació de contacte del propietari del projecte en cas de comunicacions importants, com problemes amb el teu projecte o si es converteix en elegible per a una ronda d'emparellament QF.", + "label.project_social_link": "Enllaç Social del Projecte", "label.project_social_media": "Informació de Contacte del Propietari del Projecte", "label.project_status": "Estat del projecte", "label.project_story": "Història del projecte", @@ -790,15 +793,15 @@ "label.recurring_donations_currently_only_available_on_optimism": "Les donacions recurrents actualment només estan disponibles en Optimism", "label.recurring_donation_card_subheader_1": "Transmeteu les vostres donacions al llarg del temps per proporcionar finançament continu.", "label.recurring_donation_card_subheader_2": "Decideix la quantitat de tokens a dipositar en el teu saldo de transmissió, o utilitza el/els teu(s) saldo(s) de transmissió existent(s). Estableix l'import de la donació mensual en tokens i comença a transmetre.", - "label.recurring_dontion_page" : "pàgina de donació recurrent", + "label.recurring_donation_maximum": "Aquest és el màxim que podeu donar mensualment, recarregueu el vostre saldo de reproducció per donar més!", "label.recurring_donation_setup_1": "El vostre projecte ha estat creat, a continuació necessitareu signar una transacció per habilitar-lo per rebre donacions recurrents.", "label.recurring_donation_setup_2": "Se us demanarà que signeu una transacció que executarà la configuració a ", "label.recurring_donation_updated_hours": "Les quantitats de les donacions recurrents s'actualitzen cada 24 hores.", + "label.recurring_dontion_page": "pàgina de donació recurrent", "label.refer_a_friend": "Recomana un amic, guanya tokens $GIV per cada donació.", "label.refer_your_friends": "Recomana els teus amics", "label.refer_your_friends_and_earn_giv": "Recomana els teus amics i guanya GIV quan donin", "label.refresh_score": "Refresca la puntuació", - "label.keep_eye_on_twitter": "Mantingueu un ull al Twitter de Giveth ", "label.registration": "Registre", "label.registration_confirmation": "Confirmació del registre", "label.remove": "Eliminar", @@ -857,7 +860,6 @@ "label.select_token": "Selecciona Token", "label.sending_eth_to_project_op_address": "Enviant ETH a l'adreça OP del projecte", "label.send_me_an_email": "Envia'm un correu electrònic", - "label.enable_recurring_donations": "Habilitar Donacions Recurrents", "label.set_valid_ammount": "Estableix un import vàlid", "label.share": "Compartir", "label.share_and_earn_rewards": "Comparteix i guanya recompenses", @@ -997,10 +999,10 @@ "label.the_service_is_a_kycfree_authorized_financial_intermediary": "El servei és un intermediari financer autoritzat lliure de KYC, amb seu a Suïssa", "label.think_about_where_your_potential_donors_might_look_for_a_project_like_yours": "Pensa on els teus possibles donants podrien buscar un projecte com el teu.", "label.this_address_is_already_used": "Aquesta adreça ja s'utilitza per a un altre projecte. Si us plau, introduïu una adreça que no estigui associada actualment a cap altre projecte.", + "label.this_documentation": "aquest article de documentació", "label.this_farm_has_ended": "Aquesta farm ha finalitzat", "label.this_feature_will_be_available_soon": "Aquesta funció estarà disponible aviat.", "label.this_field_is_required": "Aquest camp és obligatori", - "label.this_documentation": "aquest article de documentació", "label.this_forum_post": "aquest post del fòrum", "label.this_is_a_way_to_support_giveth_using_our": "Aquesta és una manera de donar suport a Giveth mitjançant el nostre", "label.this_is_optional": "Això és opcional", @@ -1050,6 +1052,7 @@ "label.to_activate_your_gitcoin_passport": "Per activar el teu Gitcoin Passport si us plau canvia a una cartera Ethereum.", "label.to_continue_please_remove_at_least_one_to_boost": "Per continuar amb aquest boosting, elimina almenys un altre projecte impulsat del teu compte i torna a aquest projecte de nou!", "label.to_get_more_involved": "per involucrar-se més.", + "label.to_know_next_givers_round": "per saber quan succeeix la pròxima ronda de Nominats pels Donants", "label.to_lowercase": "a", "label.to_participate_for_real_claim_your_giv": "Per participar de veritat, reclama el teu GIV.", "label.to_see_your_givpower_please_connect": "Per veure el teu GIVpower, si us plau connecta la teva cartera.", diff --git a/lang/en.json b/lang/en.json index 2fcb0324c2..d2bca8bc67 100644 --- a/lang/en.json +++ b/lang/en.json @@ -9,6 +9,7 @@ "climate-action": "Climate Action", "component.already_donated.incorrect_estimate": "You have already donated to this project so the estimated matching will be incorrect.", "component.already_donated.once_more": "Already Donated! Donate once more", + "component.archived_qf_middle_banner.desc": "Explore past quadratic funding rounds on Giveth! Check out the projects who participated, matching funds, donations and more info on this page.", "component.archive_cover.archived": "ARCHIVED", "component.archive_stream_modal.archived_title": "You have successfully archived a recurring donation", "component.archive_stream_modal.confirm_button": "Yes, Archive", @@ -143,7 +144,6 @@ "label.all_time_donations_received": "All time donations received", "label.all_time_funding": "All time funding received", "label.all_your_staked_giv_including_the_locked": "All your staked GIV, including GIV that is locked.", - "label.to_know_next_givers_round": " to know when the next Givers nominated round is happening", "label.always": "Always", "label.amount": "Amount", "label.amount_is_too_small": "Amount is too small", @@ -173,6 +173,7 @@ "label.approve_pending": "Approve pending", "label.approving": "Approving", "label.archived": "Archived", + "label.archived_qf_rounds": "Archived QF Rounds", "label.archived_rounds": "Archived Rounds", "label.archive_donation": "Archive donation", "label.archive_stream": "Archive Stream", @@ -193,6 +194,7 @@ "label.back_into_the": "back into the", "label.balance_runs_out_in": "Balance runs out in", "label.become_a_liquidity_provider": "Become a liquidity provider and stake tokens in the GIVfarm to generate even more GIV in rewards.", + "label.become_project_nominator": "Become a Project Nominator", "label.before_you_start": "Before you start", "label.better_communicate_with_the_community": "Communicate with the community.", "label.be_specific_about_your_projects_progress": "Be specific about your project's progress and goals and structure your information so it’s easy to read by adding headers and paragraphs.", @@ -243,7 +245,6 @@ "label.claim_your_givdrop": "Claim your GIVdrop", "label.clear": "Clear", "label.clear_all_filters": "Clear all Filters", - "page.verification.click_to_edit": "Click here to edit your project.", "label.close": "Close", "label.community": "Community", "label.community_connection": "Community Connection", @@ -366,6 +367,7 @@ "label.email": "email", "label.email_address": "Email Address", "label.enable_change": "Enable Change", + "label.enable_recurring_donations": "Enable Recurring Donations", "label.ends_on": "ends on", "label.end_date": "End Date", "label.end_recurring_donation": "End Recurring Donation", @@ -420,7 +422,6 @@ "label.get_rewarded_for_giving": "Get rewarded for giving to verified public goods projects with crypto donations.", "label.get_started": "Get Started", "label.get_your_donations_matched": "Get your donations matched!", - "label.become_project_nominator": "Become a Project Nominator", "label.gitcoin_passport": "Gitcoin Passport", "label.git_and_get_giv": "Give and get GIV", "label.givbacks": "GIVbacks", @@ -555,6 +556,7 @@ "label.just_launched": "Just Launched", "label.just_now": "Just now", "label.keep_an_eye_on_the_projects_page": "Keep an eye on the projects page, its position in the default sort will change within 5 minutes or less.", + "label.keep_eye_on_twitter": "Keep an eye on the Giveth Twitter ", "label.keep_it_short_and_impactful": "Keep it short and impactful – a concise title grabs attention.", "label.kyc_less_the_service_is_based_in_sw": " KYC-Less: the service is based in Switzerland and is an authorized financial intermediary", "label.last_name": "Last name", @@ -563,10 +565,10 @@ "label.learn": "Learn", "label.learn_how_to_become_an_active_part": "Learn how to become an active part of our giving network.", "label.learn_more": "Learn more", - "label.learn_more_recurring_donations": "Learn more about recurring donations on Giveth", "label.learn_more_about": "Learn more about the benefits.", "label.learn_more_about_donating_on_giveth": "Learn more about donating on Giveth", "label.learn_more_about_giv": "Learn more about GIV", + "label.learn_more_recurring_donations": "Learn more about recurring donations on Giveth", "label.learn_the_basics": "Learn the basics", "label.leave_feedback": "Leave Feedback", "label.leave_feedback.caption": "Let us know how your experience was! \n How can we improve?", @@ -578,7 +580,6 @@ "label.liked_projects": "Liked Projects", "label.likes": "Likes", "label.link_to_your_giveth_project": "Link to your Giveth project on your social media", - "label.project_social_link": "Project Social Link", "label.liquid_giv_that_has_already_flowed": "Liquid GIV that has already flowed out of the GIVstream", "label.liquid_reward_token_that_has_flowed": "Liquid {rewardTokenSymbol} that has already flowed out of the {rewardTokenSymbol}stream", "label.listing": "Listing", @@ -606,9 +607,9 @@ "label.make_your_donation_eligible_for_matching": "Make your donation eligible for matching", "label.manage_addresses": "Manage addresses", "label.manage_recurring_donations": "Manage recurring donations", - "label.managing_your_recurring_donations": "Managing your recurring donations", "label.manage_your_givpower": "Manage your GIVpower", "label.managing_funds": "Managing funds", + "label.managing_your_recurring_donations": "Managing your recurring donations", "label.mark_all_as_read": "Mark all As read", "label.matching": "Matching", "label.matching_funds_coming_soon": "Matching funds coming soon...", @@ -721,7 +722,6 @@ "label.please_do_not_enter_exchange_deposit": "Please DO NOT enter an exchange deposit address, or your funds maybe lost! Use an account you control on this network. We recommend using Metamask.", "label.please_enter_full_link": "Please enter full link", "label.please_note_it_will_take_few_minutes_for_your_giv_to_bridge": "Please note, it will take a few minutes for your GIV to bridge.", - "label.project_owner_contact_text": "Provide us with contact info for the project owner in case of important communications, such as problems with your project or if it becomes eligible for a QF matching round.", "label.please_select_a_category": "Please select a category.", "label.please_select_one_option": "Please select one option", "label.please_set_a_valid_email": "Please insert a valid email address!", @@ -755,6 +755,8 @@ "label.project_name": "Project Name", "label.project_not_available": "Oops! This project is no longer available or not found!", "label.project_official_name": "Project official name", + "label.project_owner_contact_text": "Provide us with contact info for the project owner in case of important communications, such as problems with your project or if it becomes eligible for a QF matching round.", + "label.project_social_link": "Project Social Link", "label.project_social_media": "Project Owner Contact Information", "label.project_status": "Project status", "label.project_story": "Project story", @@ -791,15 +793,15 @@ "label.recurring_donations_currently_only_available_on_optimism": "Recurring donations are currently only available on Optimism", "label.recurring_donation_card_subheader_1": "Stream your donations over time to provide continuous funding.", "label.recurring_donation_card_subheader_2": "Decide the number of tokens to deposit in your stream balance, or utilize your existing stream balance(s). Set the monthly donation amount in tokens and begin streaming.", - "label.recurring_dontion_page": "recurring donation page", + "label.recurring_donation_maximum": "This is the maximum you can donate monthly, top-up your stream balance to donate more!", "label.recurring_donation_setup_1": "Your project has now been created, next you will need to sign a transaction to enable it to receive recurring donations.", "label.recurring_donation_setup_2": "You'll be prompted to sign a transaction which will execute the setup on ", "label.recurring_donation_updated_hours": "Recurring donation amounts are updated every 24 hours.", + "label.recurring_dontion_page": "recurring donation page", "label.refer_a_friend": "Refer a friend, earn $GIV tokens for every donation.", "label.refer_your_friends": "Refer your friends", "label.refer_your_friends_and_earn_giv": "Refer your friends and earn GIV when they donate", "label.refresh_score": "Refresh score", - "label.keep_eye_on_twitter": "Keep an eye on the Giveth Twitter ", "label.registration": "Registration", "label.registration_confirmation": "Registration Confirmation", "label.remove": "Remove", @@ -858,7 +860,6 @@ "label.select_token": "Select Token", "label.sending_eth_to_project_op_address": "Sending ETH to project's OP address", "label.send_me_an_email": "Send me an email", - "label.enable_recurring_donations": "Enable Recurring Donations", "label.set_valid_ammount": "Set a valid amount", "label.share": "Share", "label.share_and_earn_rewards": "Share and earn rewards", @@ -998,10 +999,10 @@ "label.the_service_is_a_kycfree_authorized_financial_intermediary": "The service is a KYC-free authorized financial intermediary based in Switzerland", "label.think_about_where_your_potential_donors_might_look_for_a_project_like_yours": "Think about where your potential donors might look for a project like yours.", "label.this_address_is_already_used": "This address is already used for another project. Please enter an address which is not currently associated with any other project.", + "label.this_documentation": "this documentation article", "label.this_farm_has_ended": "This farm has ended", "label.this_feature_will_be_available_soon": "This feature will be available soon.", "label.this_field_is_required": "This field is required", - "label.this_documentation": "this documentation article", "label.this_forum_post": "this forum post", "label.this_is_a_way_to_support_giveth_using_our": "This is a way to support Giveth using our", "label.this_is_optional": "This is optional", @@ -1051,6 +1052,7 @@ "label.to_activate_your_gitcoin_passport": "To activate your Gitcoin Passport please Switch to an Ethereum wallet.", "label.to_continue_please_remove_at_least_one_to_boost": "To continue with this boosting, remove at least one other boosted project from your account and come back to this project again!", "label.to_get_more_involved": "to get more involved.", + "label.to_know_next_givers_round": " to know when the next Givers nominated round is happening", "label.to_lowercase": "to", "label.to_participate_for_real_claim_your_giv": "To participate for real, claim your GIV.", "label.to_see_your_givpower_please_connect": "To see your GIVpower, please connect your wallet.", @@ -1513,6 +1515,7 @@ "page.verification.before_you_start.six": "You will be required to provide a list of all wallet addresses used for managing funds within your project.", "page.verification.before_you_start.three": "The simple", "page.verification.before_you_start.two": "Once your project is verified, the Givers who donate to your project will be rewarded with GIV tokens which they can use to participate in the GIVeconomy. On the other hand, you will be required to post regular updates about your project, otherwise your verified badge could be revoked after 3 months of no updates.", + "page.verification.click_to_edit": "Click here to edit your project.", "page.verification.managing_funds.four": "Please provide additional wallet addresses used for managing funds within your project.", "page.verification.managing_funds.one": "The funds raised are expected to be used for public benefit and not for personal gain. How will you use the funds that your project raises?", "page.verification.managing_funds.three": "Additional address", diff --git a/lang/es.json b/lang/es.json index 2891f72409..152d163b1f 100644 --- a/lang/es.json +++ b/lang/es.json @@ -9,6 +9,7 @@ "climate-action": "Acción Climática", "component.already_donated.incorrect_estimate": "Ya has donado a este proyecto, por lo que la estimación de monto complementado será incorrecta.", "component.already_donated.once_more": "¡Ya has donado! Dona una vez más", + "component.archived_qf_middle_banner.desc": "¡Explora las rondas pasadas de financiamiento cuadrático en Giveth! Consulta los proyectos que participaron, los fondos de coincidencia, las donaciones y más información en esta página.", "component.archive_cover.archived": "ARCHIVADO", "component.archive_stream_modal.archived_title": "Ha archivado con éxito una donación recurrente", "component.archive_stream_modal.confirm_button": "Sí, Archivar", @@ -143,7 +144,6 @@ "label.all_time_donations_received": "Donaciones recibidas en total", "label.all_time_funding": "Financiamiento de todos los tiempos", "label.all_your_staked_giv_including_the_locked": "Todo tu GIV en stake, incluido el GIV que está bloqueado.", - "label.to_know_next_givers_round": "para saber cuándo sucede la próxima ronda de Nominados por los Donantes", "label.always": "Siempre", "label.amount": "Cantidad", "label.amount_is_too_small": "La cantidad es demasiado pequeña", @@ -173,6 +173,7 @@ "label.approve_pending": "Aprobación pendiente", "label.approving": "Aprobando", "label.archived": "Archivado", + "label.archived_qf_rounds": "Rondas de QF Archivadas", "label.archived_rounds": "Rondas Archivadas", "label.archive_donation": "Archivar donación", "label.archive_stream": "Archivar Transmisión", @@ -193,6 +194,7 @@ "label.back_into_the": "de vuelta en", "label.balance_runs_out_in": "El saldo se agota en", "label.become_a_liquidity_provider": "Conviértase en un proveedor de liquidez y haga stake de sus tokens en la GIVfarm para generar aún más GIV en recompensas.", + "label.become_project_nominator": "Conviértete en un Nominador de Proyectos", "label.before_you_start": "Antes de comenzar", "label.better_communicate_with_the_community": "Comunicarse con la comunidad.", "label.be_specific_about_your_projects_progress": "Sé específico sobre el progreso y los objetivos de tu proyecto y estructura la información para que sea fácil de leer, añadiendo encabezados y párrafos.", @@ -365,6 +367,7 @@ "label.email": "Email", "label.email_address": "Dirección de Email", "label.enable_change": "Ayuda al Cambio", + "label.enable_recurring_donations": "Habilitar Donaciones Recurrentes", "label.ends_on": "termina el", "label.end_date": "Fecha de finalización", "label.end_recurring_donation": "Finalizar Donación Recurrente", @@ -419,7 +422,6 @@ "label.get_rewarded_for_giving": "Recibe recompensas por donar a proyectos verificados de bienes públicos con donaciones en criptomonedas.", "label.get_started": "Comienza", "label.get_your_donations_matched": "Consigue que tus donaciones se igualen!", - "label.become_project_nominator": "Conviértete en un Nominador de Proyectos", "label.gitcoin_passport": "Pasaporte de Gitcoin", "label.git_and_get_giv": "Dona y obtén GIV", "label.givbacks": "devoluciones", @@ -554,6 +556,7 @@ "label.just_launched": "Acabado de Lanzar", "label.just_now": "Justo ahora", "label.keep_an_eye_on_the_projects_page": "Mantén un ojo en la página de proyectos, su posición en la ordenación por defecto cambiará en 5 minutos o menos.", + "label.keep_eye_on_twitter": "Mantén un ojo en el Twitter de Giveth ", "label.keep_it_short_and_impactful": "Manténlo breve e impactante: un título conciso capta la atención.", "label.kyc_less_the_service_is_based_in_sw": " sin 'KYC': el servicio esta localizado en Suiza y es un intermediario financiero autorizado", "label.last_name": "Apellido", @@ -562,10 +565,10 @@ "label.learn": "Aprender", "label.learn_how_to_become_an_active_part": "Aprenda cómo convertirse en un agente activo de nuestra red de donaciones.", "label.learn_more": "Aprende más", - "label.learn_more_recurring_donations": "Aprenda más sobre las donaciones recurrentes en Giveth", "label.learn_more_about": "Aprende más sobre los beneficios.", "label.learn_more_about_donating_on_giveth": "Aprende más sobre donar en Giveth", "label.learn_more_about_giv": "Aprende más sobre GIV", + "label.learn_more_recurring_donations": "Aprenda más sobre las donaciones recurrentes en Giveth", "label.learn_the_basics": "Aprende los conceptos básicos", "label.leave_feedback": "Deja retroalimentación", "label.leave_feedback.caption": "¡Dinos cómo fue tu experiencia! \n ¿cómo podemos mejorar?", @@ -577,7 +580,6 @@ "label.liked_projects": "Proyectos Favoritos", "label.likes": "Favoritos", "label.link_to_your_giveth_project": "Enlace al proyecto de Giveth en sus redes sociales", - "label.project_social_link": "Proyecto Enlace Social", "label.liquid_giv_that_has_already_flowed": "GIV liquido que ya ha fluido de tu GIVstream", "label.liquid_reward_token_that_has_flowed": "{rewardTokenSymbol} liquido que ha fluido del {rewardTokenSymbol}stream", "label.listing": "Listado", @@ -605,9 +607,9 @@ "label.make_your_donation_eligible_for_matching": "Haz que tu donación sea elegible para igualar", "label.manage_addresses": "Gestionar direcciones", "label.manage_recurring_donations": "Gestionar donaciones recurrentes", - "label.managing_your_recurring_donations": "Gestionando tus donaciones recurrentes", "label.manage_your_givpower": "Administrar su GIVpower", "label.managing_funds": "Manejo de fondos", + "label.managing_your_recurring_donations": "Gestionando tus donaciones recurrentes", "label.mark_all_as_read": "Marcar todas como leídas", "label.matching": "Emparejamiento", "label.matching_funds_coming_soon": "Fondos de emparejamiento próximamente...", @@ -720,7 +722,6 @@ "label.please_do_not_enter_exchange_deposit": "¡Por favor, NO introduzcas una dirección de depósito de intercambio, o podrías perder tus fondos! Usa una cuenta que controles en esta red. Recomendamos usar Metamask.", "label.please_enter_full_link": "Por favor, introduzca el enlace completo", "label.please_note_it_will_take_few_minutes_for_your_giv_to_bridge": "Por favor ten en cuenta que tomará unos minutos para que tu GIV se transfiera.", - "label.project_owner_contact_text": "Proporciónanos la información de contacto del propietario del proyecto en caso de comunicaciones importantes, como problemas con tu proyecto o si se convierte en elegible para una ronda de emparejamiento QF.", "label.please_select_a_category": "Por favor selecciona una categoria.", "label.please_select_one_option": "Porfavor escoge una opción", "label.please_set_a_valid_email": "¡Por favor introduce un email válido!", @@ -754,6 +755,8 @@ "label.project_name": "Nombre del Proyecto", "label.project_not_available": "¡Ups! ¡Este proyecto ya no está disponible o no se encuentra!", "label.project_official_name": "Nombre oficial del proyecto", + "label.project_owner_contact_text": "Proporciónanos la información de contacto del propietario del proyecto en caso de comunicaciones importantes, como problemas con tu proyecto o si se convierte en elegible para una ronda de emparejamiento QF.", + "label.project_social_link": "Proyecto Enlace Social", "label.project_social_media": "Información de Contacto del Propietario del Proyecto", "label.project_status": "Estado del Proyecto", "label.project_story": "Historia del proyecto", @@ -790,15 +793,15 @@ "label.recurring_donations_currently_only_available_on_optimism": "Las donaciones recurrentes actualmente solo están disponibles en Optimism", "label.recurring_donation_card_subheader_1": "Transmite tus donaciones con el tiempo para proporcionar financiamiento continuo.", "label.recurring_donation_card_subheader_2": "Decide la cantidad de tokens a depositar en tu saldo de transmisión, o utiliza tu(s) saldo(s) de transmisión existente(s). Establece el monto de la donación mensual en tokens y comienza a transmitir.", - "label.recurring_dontion_page" : "página de donación recurrente", + "label.recurring_donation_maximum": "Este es el máximo que puedes donar mensualmente. ¡Recarga tu saldo de transmisión para donar más!", "label.recurring_donation_setup_1": "Su proyecto ha sido creado, a continuación necesitará firmar una transacción para habilitarlo para recibir donaciones recurrentes.", "label.recurring_donation_setup_2": "Se le pedirá que firme una transacción que ejecutará la configuración en ", "label.recurring_donation_updated_hours": "Las cantidades de las donaciones recurrentes se actualizan cada 24 horas.", + "label.recurring_dontion_page": "página de donación recurrente", "label.refer_a_friend": "Referir a un amigo, ganar tokens $GIV por cada donación.", "label.refer_your_friends": "Refiere a tus amigos", "label.refer_your_friends_and_earn_giv": "Refiere a tus amigos y gana GIV", "label.refresh_score": "Actualizar puntaje", - "label.keep_eye_on_twitter": "Mantén un ojo en el Twitter de Giveth ", "label.registration": "Registro", "label.registration_confirmation": "Confirmación de Registro", "label.remove": "Eliminar", @@ -857,7 +860,6 @@ "label.select_token": "Seleccionar Token", "label.sending_eth_to_project_op_address": "Enviando ETH a la dirección OP del proyecto", "label.send_me_an_email": "Envíame un email", - "label.enable_recurring_donations": "Habilitar Donaciones Recurrentes", "label.set_valid_ammount": "Establece un monto válido", "label.share": "Compartir", "label.share_and_earn_rewards": "Comparte y obtén recompensas", @@ -997,10 +999,10 @@ "label.the_service_is_a_kycfree_authorized_financial_intermediary": "Son una entidad financiera autorizada localizada en Suiza, libre de KYC", "label.think_about_where_your_potential_donors_might_look_for_a_project_like_yours": "Piensa dónde tus posibles donantes podrían buscar un proyecto como el tuyo.", "label.this_address_is_already_used": "Esta dirección ya esta en uso para otro proyecto. Por favor ingrese una dirección que no este actualmente asociada a ningún otro proyecto.", + "label.this_documentation": "este artículo de documentación", "label.this_farm_has_ended": "Esta Farm ha terminado", "label.this_feature_will_be_available_soon": "Esta función estará disponible pronto.", "label.this_field_is_required": "Este campo es requerido", - "label.this_documentation": "este artículo de documentación", "label.this_forum_post": "este post del foro", "label.this_is_a_way_to_support_giveth_using_our": "Esta es una manera de apoyar a Giveth usando nuestro", "label.this_is_optional": "Esto es opcional", @@ -1050,6 +1052,7 @@ "label.to_activate_your_gitcoin_passport": "Para activar tu Pasaporte de Gitcoin por favor cambia a una cartera Ethereum.", "label.to_continue_please_remove_at_least_one_to_boost": "Para continuar con este boost, elimina al menos otro proyecto boosteado de tu cuenta y vuelve a este proyecto de nuevo!", "label.to_get_more_involved": "para involucrarse más.", + "label.to_know_next_givers_round": "para saber cuándo sucede la próxima ronda de Nominados por los Donantes", "label.to_lowercase": "para", "label.to_participate_for_real_claim_your_giv": "Para participar de verdad, reclama tu GIV.", "label.to_see_your_givpower_please_connect": "Para ver tu GIVpower, por favor conecta tu billetera.", diff --git a/next.config.js b/next.config.js index ff45bea733..d35f345841 100644 --- a/next.config.js +++ b/next.config.js @@ -139,6 +139,10 @@ const moduleExports = withBundleAnalyzer({ defaultLocale, localeDetection: false, }, + env: { + locales, + defaultLocale, + }, headers: () => { return [ { diff --git a/package.json b/package.json index 9b3b0c4d7c..603286e0f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "givethdapp", - "version": "2.26.1", + "version": "2.27.0", "private": true, "scripts": { "build": "next build", @@ -18,7 +18,7 @@ }, "dependencies": { "@apollo/client": "^3.10.4", - "@giveth/ui-design-system": "^1.11.27", + "@giveth/ui-design-system": "^1.11.28", "@reduxjs/toolkit": "^2.2.4", "@safe-global/api-kit": "^2.1.0", "@segment/snippet": "^4.15.3", diff --git a/pages/donate/[slug].tsx b/pages/donate/[slug].tsx index fed026867a..efcb9d7bc8 100644 --- a/pages/donate/[slug].tsx +++ b/pages/donate/[slug].tsx @@ -3,22 +3,18 @@ import { GetServerSideProps } from 'next/types'; import Head from 'next/head'; import { captureException } from '@sentry/nextjs'; -import { IDonationProject } from '@/apollo/types/types'; -import { - FETCH_GIVETH_PROJECT_BY_ID, - FETCH_PROJECT_BY_SLUG_DONATION, -} from '@/apollo/gql/gqlProjects'; +import { IProject } from '@/apollo/types/types'; +import { FETCH_PROJECT_BY_SLUG_DONATION } from '@/apollo/gql/gqlProjects'; import { client } from '@/apollo/apolloClient'; import { ProjectMeta } from '@/components/Metatag'; import { transformGraphQLErrorsToStatusCode } from '@/helpers/requests'; -import config from '@/configuration'; import { DonateProvider } from '@/context/donate.context'; import DonateIndex from '@/components/views/donate/DonateIndex'; import { useAppDispatch } from '@/features/hooks'; import { setShowFooter } from '@/features/general/general.slice'; export interface IDonateRouteProps { - project: IDonationProject; + project: IProject; } const DonateRoute: FC = ({ project }) => { @@ -51,19 +47,9 @@ export const getServerSideProps: GetServerSideProps = async props => { variables: { slug }, fetchPolicy: 'no-cache', }); - const { data: givethProjectData } = await client.query({ - query: FETCH_GIVETH_PROJECT_BY_ID, - variables: { id: config.GIVETH_PROJECT_ID }, - fetchPolicy: 'no-cache', - }); - - const project = { - ...data.projectBySlug, - givethAddresses: givethProjectData.projectById.addresses, - }; return { props: { - project, + project: data.projectBySlug, }, }; } catch (error: any) { diff --git a/pages/projects/[slug].tsx b/pages/projects/[slug].tsx index 0188c50efd..a7490ae6fa 100644 --- a/pages/projects/[slug].tsx +++ b/pages/projects/[slug].tsx @@ -1,5 +1,5 @@ import { GetServerSideProps } from 'next/types'; -import { IMainCategory, IProject, IQFRound } from '@/apollo/types/types'; +import { IMainCategory, IProject } from '@/apollo/types/types'; import { transformGraphQLErrorsToStatusCode } from '@/helpers/requests'; import { initializeApollo } from '@/apollo/apolloClient'; import { OPTIONS_HOME_PROJECTS } from '@/apollo/gql/gqlOptions'; @@ -12,7 +12,6 @@ import ProjectsIndex from '@/components/views/projects/ProjectsIndex'; import { useReferral } from '@/hooks/useReferral'; import { projectsMetatags } from '@/content/metatags'; import { ProjectsProvider } from '@/context/projects.context'; -import { FETCH_QF_ROUNDS } from '@/apollo/gql/gqlQF'; import { getMainCategorySlug } from '@/helpers/projects'; import { EProjectsSortBy } from '@/apollo/types/gqlEnums'; @@ -20,7 +19,6 @@ export interface IProjectsRouteProps { projects: IProject[]; totalCount: number; mainCategories: IMainCategory[]; - qfRounds: IQFRound[]; } export const allCategoriesItem = { @@ -37,13 +35,8 @@ interface IProjectsCategoriesRouteProps extends IProjectsRouteProps { } const ProjectsCategoriesRoute = (props: IProjectsCategoriesRouteProps) => { - const { - projects, - mainCategories, - selectedMainCategory, - totalCount, - qfRounds, - } = props; + const { projects, mainCategories, selectedMainCategory, totalCount } = + props; useReferral(); @@ -52,7 +45,6 @@ const ProjectsCategoriesRoute = (props: IProjectsCategoriesRouteProps) => { mainCategories={mainCategories} selectedMainCategory={selectedMainCategory} isQF={false} - qfRounds={qfRounds} > @@ -108,19 +100,12 @@ export const getServerSideProps: GetServerSideProps = async context => { fetchPolicy: 'network-only', }); const { projects, totalCount } = data.allProjects; - const { - data: { qfRounds }, - } = await apolloClient.query({ - query: FETCH_QF_ROUNDS, - fetchPolicy: 'network-only', - }); return { props: { projects, mainCategories: updatedMainCategory, selectedMainCategory: updatedSelectedMainCategory, totalCount, - qfRounds, }, }; } diff --git a/pages/qf-archive/[slug].tsx b/pages/qf-archive/[slug].tsx index 0ce7394a28..3bb84f9150 100644 --- a/pages/qf-archive/[slug].tsx +++ b/pages/qf-archive/[slug].tsx @@ -11,13 +11,14 @@ import { GeneralMetatags } from '@/components/Metatag'; import ProjectsIndex from '@/components/views/projects/ProjectsIndex'; import { projectsMetatags } from '@/content/metatags'; import { ProjectsProvider } from '@/context/projects.context'; -import { FETCH_QF_ROUNDS } from '@/apollo/gql/gqlQF'; import { useReferral } from '@/hooks/useReferral'; import { IProjectsRouteProps, allCategoriesItem } from 'pages/projects/[slug]'; import { EProjectsSortBy } from '@/apollo/types/gqlEnums'; +import { FETCH_QF_ROUNDS_QUERY } from '@/apollo/gql/gqlQF'; interface IProjectsCategoriesRouteProps extends IProjectsRouteProps { selectedMainCategory: IMainCategory; + archivedQFRound: IQFRound; } const QFProjectsCategoriesRoute = (props: IProjectsCategoriesRouteProps) => { @@ -26,7 +27,7 @@ const QFProjectsCategoriesRoute = (props: IProjectsCategoriesRouteProps) => { mainCategories, selectedMainCategory, totalCount, - qfRounds, + archivedQFRound, } = props; useReferral(); @@ -35,9 +36,9 @@ const QFProjectsCategoriesRoute = (props: IProjectsCategoriesRouteProps) => { @@ -66,7 +67,7 @@ export const getServerSideProps: GetServerSideProps = async context => { data: { mainCategories: IMainCategory[] }; } = await apolloClient.query({ query: FETCH_MAIN_CATEGORIES, - fetchPolicy: 'network-only', + fetchPolicy: 'no-cache', }); const updatedMainCategory = [allCategoriesItem, ...mainCategories]; @@ -85,22 +86,21 @@ export const getServerSideProps: GetServerSideProps = async context => { qfRoundSlug: slug, notifyOnNetworkStatusChange, }, - fetchPolicy: 'network-only', + fetchPolicy: 'no-cache', }); const { projects, totalCount } = data.allProjects; const { data: { qfRounds }, } = await apolloClient.query({ - query: FETCH_QF_ROUNDS, - fetchPolicy: 'network-only', + query: FETCH_QF_ROUNDS_QUERY, + variables: { slug }, + fetchPolicy: 'no-cache', }); - const roundExists = (qfRounds as IQFRound[]).some( - round => round.slug === slug, - ); + const archivedQFRound = qfRounds ? qfRounds[0] : undefined; - if (!roundExists) { + if (!archivedQFRound) { return { notFound: true, }; @@ -112,7 +112,7 @@ export const getServerSideProps: GetServerSideProps = async context => { mainCategories: updatedMainCategory, selectedMainCategory: updatedSelectedMainCategory, totalCount, - qfRounds, + archivedQFRound, }, }; } catch (error: any) { diff --git a/pages/qf-archive/index.tsx b/pages/qf-archive/index.tsx index 278b1db202..7c1a81cc35 100644 --- a/pages/qf-archive/index.tsx +++ b/pages/qf-archive/index.tsx @@ -1,11 +1,22 @@ +import { GeneralMetatags } from '@/components/Metatag'; import { ArchivedQFRoundsView } from '@/components/views/archivedQFRounds/ArchivedQFRounds.view'; import { ArchivedQFRoundsProvider } from '@/components/views/archivedQFRounds/archivedQfRounds.context'; const ArchivedQFPageRoute = () => { return ( - - - + <> + + + + + ); }; export default ArchivedQFPageRoute; diff --git a/pages/qf/[slug].tsx b/pages/qf/[slug].tsx index 9221a38b10..7d221aebb6 100644 --- a/pages/qf/[slug].tsx +++ b/pages/qf/[slug].tsx @@ -11,7 +11,6 @@ import { GeneralMetatags } from '@/components/Metatag'; import ProjectsIndex from '@/components/views/projects/ProjectsIndex'; import { projectsMetatags } from '@/content/metatags'; import { ProjectsProvider } from '@/context/projects.context'; -import { FETCH_QF_ROUNDS } from '@/apollo/gql/gqlQF'; import { useReferral } from '@/hooks/useReferral'; import { IProjectsRouteProps, allCategoriesItem } from 'pages/projects/[slug]'; import { getMainCategorySlug } from '@/helpers/projects'; @@ -22,13 +21,8 @@ interface IProjectsCategoriesRouteProps extends IProjectsRouteProps { } const QFProjectsCategoriesRoute = (props: IProjectsCategoriesRouteProps) => { - const { - projects, - mainCategories, - selectedMainCategory, - totalCount, - qfRounds, - } = props; + const { projects, mainCategories, selectedMainCategory, totalCount } = + props; useReferral(); @@ -36,7 +30,6 @@ const QFProjectsCategoriesRoute = (props: IProjectsCategoriesRouteProps) => { @@ -100,19 +93,12 @@ export const getServerSideProps: GetServerSideProps = async context => { fetchPolicy: 'network-only', }); const { projects, totalCount } = data.allProjects; - const { - data: { qfRounds }, - } = await apolloClient.query({ - query: FETCH_QF_ROUNDS, - fetchPolicy: 'network-only', - }); return { props: { projects, mainCategories: updatedMainCategory, selectedMainCategory: updatedSelectedMainCategory, totalCount, - qfRounds, }, }; } diff --git a/pages/user/[address].tsx b/pages/user/[address].tsx index 5916902874..1dcb20ad1d 100644 --- a/pages/user/[address].tsx +++ b/pages/user/[address].tsx @@ -11,6 +11,7 @@ import ErrorsIndex from '@/components/views/Errors/ErrorsIndex'; import { ProfileProvider } from '@/context/profile.context'; import { useAppSelector } from '@/features/hooks'; import { useReferral } from '@/hooks/useReferral'; +import { getUserName } from '@/helpers/user'; interface IUserRouteProps { user?: IUser; @@ -20,7 +21,6 @@ const UserRoute: FC = ({ user }) => { const { isSignedIn, userData } = useAppSelector(state => state.user); useReferral(); - // When user is not found, GQL doesn't return any error. After backend is fixed, this can be deleted. if (!user) { return ; } @@ -29,13 +29,13 @@ const UserRoute: FC = ({ user }) => { user.walletAddress?.toLowerCase() === userData?.walletAddress?.toLowerCase(); + const userName = getUserName(user, true); + return ( <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/currencies/base/16.svg b/public/images/currencies/base/16.svg new file mode 100644 index 0000000000..f0b162ffb2 --- /dev/null +++ b/public/images/currencies/base/16.svg @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/public/images/tokens/AERO.png b/public/images/tokens/AERO.png new file mode 100644 index 0000000000..bc0145aed3 Binary files /dev/null and b/public/images/tokens/AERO.png differ diff --git a/public/images/tokens/AERO.svg b/public/images/tokens/AERO.svg new file mode 100644 index 0000000000..7f3a9e85f0 --- /dev/null +++ b/public/images/tokens/AERO.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/AMKT.png b/public/images/tokens/AMKT.png new file mode 100644 index 0000000000..854c646ce7 Binary files /dev/null and b/public/images/tokens/AMKT.png differ diff --git a/public/images/tokens/AMKT.svg b/public/images/tokens/AMKT.svg new file mode 100644 index 0000000000..f963909cbd --- /dev/null +++ b/public/images/tokens/AMKT.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/BTRST.png b/public/images/tokens/BTRST.png new file mode 100644 index 0000000000..26adc8bed4 Binary files /dev/null and b/public/images/tokens/BTRST.png differ diff --git a/public/images/tokens/BTRST.svg b/public/images/tokens/BTRST.svg new file mode 100644 index 0000000000..d8a5829597 --- /dev/null +++ b/public/images/tokens/BTRST.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/DEGEN.png b/public/images/tokens/DEGEN.png new file mode 100644 index 0000000000..d559ac01ca Binary files /dev/null and b/public/images/tokens/DEGEN.png differ diff --git a/public/images/tokens/DEGEN.svg b/public/images/tokens/DEGEN.svg new file mode 100644 index 0000000000..32c5067d4e --- /dev/null +++ b/public/images/tokens/DEGEN.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/DEUS.png b/public/images/tokens/DEUS.png new file mode 100644 index 0000000000..2d4c2f07e4 Binary files /dev/null and b/public/images/tokens/DEUS.png differ diff --git a/public/images/tokens/DEUS.svg b/public/images/tokens/DEUS.svg new file mode 100644 index 0000000000..eda7b66696 --- /dev/null +++ b/public/images/tokens/DEUS.svg @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/DOLA.png b/public/images/tokens/DOLA.png new file mode 100644 index 0000000000..f3de7edcdb Binary files /dev/null and b/public/images/tokens/DOLA.png differ diff --git a/public/images/tokens/DOLA.svg b/public/images/tokens/DOLA.svg new file mode 100644 index 0000000000..335712b6b7 --- /dev/null +++ b/public/images/tokens/DOLA.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/EXTRA.png b/public/images/tokens/EXTRA.png new file mode 100644 index 0000000000..0aeb6095f6 Binary files /dev/null and b/public/images/tokens/EXTRA.png differ diff --git a/public/images/tokens/EXTRA.svg b/public/images/tokens/EXTRA.svg new file mode 100644 index 0000000000..7abd83feaa --- /dev/null +++ b/public/images/tokens/EXTRA.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/GRG.png b/public/images/tokens/GRG.png new file mode 100644 index 0000000000..30afea4eb2 Binary files /dev/null and b/public/images/tokens/GRG.png differ diff --git a/public/images/tokens/GRG.svg b/public/images/tokens/GRG.svg new file mode 100644 index 0000000000..98c727e08e --- /dev/null +++ b/public/images/tokens/GRG.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/MAV.png b/public/images/tokens/MAV.png new file mode 100644 index 0000000000..df92aa8d18 Binary files /dev/null and b/public/images/tokens/MAV.png differ diff --git a/public/images/tokens/MAV.svg b/public/images/tokens/MAV.svg new file mode 100644 index 0000000000..5702955a8d --- /dev/null +++ b/public/images/tokens/MAV.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/MAVIA.png b/public/images/tokens/MAVIA.png new file mode 100644 index 0000000000..0b5d67561f Binary files /dev/null and b/public/images/tokens/MAVIA.png differ diff --git a/public/images/tokens/MAVIA.svg b/public/images/tokens/MAVIA.svg new file mode 100644 index 0000000000..2586409518 --- /dev/null +++ b/public/images/tokens/MAVIA.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/MBS.png b/public/images/tokens/MBS.png new file mode 100644 index 0000000000..c247e274e9 Binary files /dev/null and b/public/images/tokens/MBS.png differ diff --git a/public/images/tokens/MBS.svg b/public/images/tokens/MBS.svg new file mode 100644 index 0000000000..d426f67603 --- /dev/null +++ b/public/images/tokens/MBS.svg @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/OSAK.png b/public/images/tokens/OSAK.png new file mode 100644 index 0000000000..51fd9e99ac Binary files /dev/null and b/public/images/tokens/OSAK.png differ diff --git a/public/images/tokens/OSAK.svg b/public/images/tokens/OSAK.svg new file mode 100644 index 0000000000..0d2b92240b --- /dev/null +++ b/public/images/tokens/OSAK.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/PRIME.png b/public/images/tokens/PRIME.png new file mode 100644 index 0000000000..ac51b15a6e Binary files /dev/null and b/public/images/tokens/PRIME.png differ diff --git a/public/images/tokens/PRIME.svg b/public/images/tokens/PRIME.svg new file mode 100644 index 0000000000..ea7f731d1b --- /dev/null +++ b/public/images/tokens/PRIME.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/SDEX.svg b/public/images/tokens/SDEX.svg index 70bef95b07..f1cec754ad 100644 --- a/public/images/tokens/SDEX.svg +++ b/public/images/tokens/SDEX.svg @@ -1,9 +1,12 @@ - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/SEAM.png b/public/images/tokens/SEAM.png new file mode 100644 index 0000000000..31d4ee08e7 Binary files /dev/null and b/public/images/tokens/SEAM.png differ diff --git a/public/images/tokens/SEAM.svg b/public/images/tokens/SEAM.svg new file mode 100644 index 0000000000..beb9a74ab9 --- /dev/null +++ b/public/images/tokens/SEAM.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/public/images/tokens/SOFI.png b/public/images/tokens/SOFI.png new file mode 100644 index 0000000000..80afec2137 Binary files /dev/null and b/public/images/tokens/SOFI.png differ diff --git a/public/images/tokens/SOFI.svg b/public/images/tokens/SOFI.svg new file mode 100644 index 0000000000..f6b9967eae --- /dev/null +++ b/public/images/tokens/SOFI.svg @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/SPEC.png b/public/images/tokens/SPEC.png new file mode 100644 index 0000000000..42189b6b9d Binary files /dev/null and b/public/images/tokens/SPEC.png differ diff --git a/public/images/tokens/SPEC.svg b/public/images/tokens/SPEC.svg new file mode 100644 index 0000000000..19562b3995 --- /dev/null +++ b/public/images/tokens/SPEC.svg @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/public/images/tokens/SQT.png b/public/images/tokens/SQT.png new file mode 100644 index 0000000000..16731a9f5c Binary files /dev/null and b/public/images/tokens/SQT.png differ diff --git a/public/images/tokens/SQT.svg b/public/images/tokens/SQT.svg new file mode 100644 index 0000000000..660ad00a16 --- /dev/null +++ b/public/images/tokens/SQT.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/USD+.png b/public/images/tokens/USD+.png new file mode 100644 index 0000000000..8536d4b8e8 Binary files /dev/null and b/public/images/tokens/USD+.png differ diff --git a/public/images/tokens/USD+.svg b/public/images/tokens/USD+.svg new file mode 100644 index 0000000000..c07337a121 --- /dev/null +++ b/public/images/tokens/USD+.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/USDbC.png b/public/images/tokens/USDbC.png new file mode 100644 index 0000000000..7e356e76e7 Binary files /dev/null and b/public/images/tokens/USDbC.png differ diff --git a/public/images/tokens/USDbC.svg b/public/images/tokens/USDbC.svg new file mode 100644 index 0000000000..c16c1343c7 --- /dev/null +++ b/public/images/tokens/USDbC.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/public/images/tokens/AGEUR.png b/public/images/tokens/agEUR.png similarity index 100% rename from public/images/tokens/AGEUR.png rename to public/images/tokens/agEUR.png diff --git a/public/images/tokens/AGEUR.svg b/public/images/tokens/agEUR.svg similarity index 100% rename from public/images/tokens/AGEUR.svg rename to public/images/tokens/agEUR.svg diff --git a/public/images/tokens/cbETH.png b/public/images/tokens/cbETH.png new file mode 100644 index 0000000000..315f4d8aa1 Binary files /dev/null and b/public/images/tokens/cbETH.png differ diff --git a/public/images/tokens/cbETH.svg b/public/images/tokens/cbETH.svg new file mode 100644 index 0000000000..65388e3d04 --- /dev/null +++ b/public/images/tokens/cbETH.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/public/images/tokens/RETH.png b/public/images/tokens/rETH.png similarity index 100% rename from public/images/tokens/RETH.png rename to public/images/tokens/rETH.png diff --git a/public/images/tokens/RETH.svg b/public/images/tokens/rETH.svg similarity index 100% rename from public/images/tokens/RETH.svg rename to public/images/tokens/rETH.svg diff --git a/src/apollo/gql/gqlProjects.ts b/src/apollo/gql/gqlProjects.ts index bd60b74eeb..46dd9e14d9 100644 --- a/src/apollo/gql/gqlProjects.ts +++ b/src/apollo/gql/gqlProjects.ts @@ -48,7 +48,6 @@ export const PROJECT_CARD_FIELDS = gql` round } sumDonationValueUsdForActiveQfRound - sumDonationValueUsd countUniqueDonorsForActiveQfRound countUniqueDonors estimatedMatching { @@ -147,7 +146,6 @@ export const FETCH_PROJECT_BY_SLUG_DONATION = gql` slug descriptionSummary verified - sumDonationValueUsd sumDonationValueUsdForActiveQfRound countUniqueDonorsForActiveQfRound adminUser { @@ -261,7 +259,6 @@ export const FETCH_PROJECT_BY_SLUG_SINGLE_PROJECT = gql` } givbackFactor sumDonationValueUsdForActiveQfRound - sumDonationValueUsd countUniqueDonorsForActiveQfRound countUniqueDonors estimatedMatching { diff --git a/src/apollo/gql/gqlQF.ts b/src/apollo/gql/gqlQF.ts index 8662e9b751..aefc396415 100644 --- a/src/apollo/gql/gqlQF.ts +++ b/src/apollo/gql/gqlQF.ts @@ -1,8 +1,8 @@ import { gql } from '@apollo/client'; -export const FETCH_QF_ROUNDS_QUERY = ` - query FetchQFRounds { - qfRounds { +export const FETCH_QF_ROUNDS_QUERY = gql` + query FetchQFRounds($slug: String, $activeOnly: Boolean) { + qfRounds(slug: $slug, activeOnly: $activeOnly) { id slug name @@ -22,10 +22,6 @@ export const FETCH_QF_ROUNDS_QUERY = ` } `; -export const FETCH_QF_ROUNDS = gql` - ${FETCH_QF_ROUNDS_QUERY} -`; - export const FETCH_DOES_DONATED_PROJECT_IN_ROUND = gql` query ($projectId: Int!, $qfRoundId: Int!, $userId: Int!) { doesDonatedToProjectInQfRound( diff --git a/src/apollo/gql/gqlUser.ts b/src/apollo/gql/gqlUser.ts index c87d83ce0c..e4a357148b 100644 --- a/src/apollo/gql/gqlUser.ts +++ b/src/apollo/gql/gqlUser.ts @@ -144,6 +144,7 @@ export const FETCH_USER_RECURRING_DONATIONS = gql` status isArchived amountStreamed + totalUsdStreamed project { id title diff --git a/src/apollo/types/types.ts b/src/apollo/types/types.ts index c56aea5271..fc1f98d452 100644 --- a/src/apollo/types/types.ts +++ b/src/apollo/types/types.ts @@ -77,7 +77,6 @@ export interface IProject { countUniqueDonors?: number; countUniqueDonorsForActiveQfRound?: number; estimatedMatching: IEstimatedMatching; - sumDonationValueUsd?: number; sumDonationValueUsdForActiveQfRound?: number; qfRounds?: IQFRound[]; campaigns?: ICampaign[]; @@ -85,10 +84,6 @@ export interface IProject { socialMedia: IProjectSocialMedia[]; } -export interface IDonationProject extends IProject { - givethAddresses: IWalletAddress[]; -} - export enum EProjectsFilter { ACCEPT_GIV = 'AcceptGiv', VERIFIED = 'Verified', @@ -99,6 +94,7 @@ export enum EProjectsFilter { ACCEPT_FUND_ON_POLYGON = 'AcceptFundOnPolygon', ACCEPT_FUND_ON_CELO = 'AcceptFundOnCelo', ACCEPT_FUND_ON_ARBITRUM = 'AcceptFundOnArbitrum', + ACCEPT_FUND_ON_BASE = 'AcceptFundOnBase', ACCEPT_FUND_ON_OPTIMISM = 'AcceptFundOnOptimism', ACCEPT_FUND_ON_ETC = 'AcceptFundOnETC', ACCEPT_FUND_ON_SOLANA = 'AcceptFundOnSolana', @@ -122,6 +118,7 @@ export enum ECampaignFilterField { AcceptFundOnPolygon = 'acceptFundOnPolygon', AcceptFundOnCelo = 'acceptFundOnCelo', AcceptFundOnArbitrum = 'acceptFundOnArbitrum', + AcceptFundOnBase = 'acceptFundOnBase', AcceptFundOnOptimism = 'acceptFundOnOptimism', AcceptFundOnSolana = 'acceptFundOnSolana', } @@ -282,6 +279,7 @@ export interface IWalletRecurringDonation { flowRate: string; currency: string; amountStreamed: string; + totalUsdStreamed: string; networkId: number; finished: boolean; anonymous: boolean; diff --git a/src/components/AmountInput/AmountInput.tsx b/src/components/AmountInput/AmountInput.tsx index 4289f312eb..fd5d1f60e8 100644 --- a/src/components/AmountInput/AmountInput.tsx +++ b/src/components/AmountInput/AmountInput.tsx @@ -47,7 +47,6 @@ export const AmountInput: FC = ({ const [displayAmount, setDisplayAmount] = useState(''); useEffect(() => { - if (!amount) return; const _displayAmount = truncateToDecimalPlaces( formatUnits(amount, decimals), decimals / 3, diff --git a/src/components/DefaultQFBanner.tsx b/src/components/DefaultQFBanner.tsx new file mode 100644 index 0000000000..f28c54474a --- /dev/null +++ b/src/components/DefaultQFBanner.tsx @@ -0,0 +1,40 @@ +import styled from 'styled-components'; +import Image from 'next/image'; +import { H1, semanticColors } from '@giveth/ui-design-system'; + +export const DefaultQFBanner = () => { + return ( + + QF Banner + Quadratic Funding + + ); +}; + +const BannerContainer = styled.div` + position: relative; + padding-top: 160px; + padding-bottom: 160px; + /* height: 500px; */ + img { + -webkit-user-drag: none; + -khtml-user-drag: none; + -moz-user-drag: none; + -o-user-drag: none; + user-drag: none; + } +`; + +const StyledH1 = styled(H1)` + position: relative; + /* top: 50%; + left: 50%; + transform: translate(-50%, -50%); */ + color: ${semanticColors.golden[500]}; + text-align: center; +`; diff --git a/src/components/GIVeconomyPages/GIVbacks.tsx b/src/components/GIVeconomyPages/GIVbacks.tsx index d64872f7ed..88f43449ea 100644 --- a/src/components/GIVeconomyPages/GIVbacks.tsx +++ b/src/components/GIVeconomyPages/GIVbacks.tsx @@ -1,13 +1,13 @@ import React, { useState, useEffect, useMemo } from 'react'; import { IconExternalLink, - IconGIVBack, P, brandColors, Col, Container, Row, Flex, + IconGIVBack64, } from '@giveth/ui-design-system'; import Link from 'next/link'; import { useIntl } from 'react-intl'; @@ -83,7 +83,7 @@ export const TabGIVbacksTop = () => { GIVbacks - + {formatMessage({ diff --git a/src/components/GIVeconomyPages/GIVstream.tsx b/src/components/GIVeconomyPages/GIVstream.tsx index a7de0680cc..dac94912ec 100644 --- a/src/components/GIVeconomyPages/GIVstream.tsx +++ b/src/components/GIVeconomyPages/GIVstream.tsx @@ -6,7 +6,6 @@ import { H1, H3, H6, - IconGIVBack, IconGIVFarm, IconGIVStream, IconHelpFilled16, @@ -17,6 +16,7 @@ import { Row, Col, Flex, + IconGIVBack24, } from '@giveth/ui-design-system'; import { useIntl } from 'react-intl'; import { useAccount } from 'wagmi'; @@ -338,7 +338,7 @@ const convertSourceTypeToIcon = (distributor: string) => { case 'givback': return ( - +

{` GIVbacks`}

); diff --git a/src/components/Icons/Base.tsx b/src/components/Icons/Base.tsx new file mode 100644 index 0000000000..626a83cc5d --- /dev/null +++ b/src/components/Icons/Base.tsx @@ -0,0 +1,17 @@ +import React, { FC } from 'react'; +import Image from 'next/image'; +import { ICurrencyIconProps } from './type'; + +const IconBase: FC = ({ size = 16 }) => { + return ( + Base icon + ); +}; + +export default IconBase; diff --git a/src/components/NetworkSelector.tsx b/src/components/NetworkSelector.tsx index cfa73de230..f8daeb41da 100644 --- a/src/components/NetworkSelector.tsx +++ b/src/components/NetworkSelector.tsx @@ -40,6 +40,7 @@ const _options = [ { network: config.CLASSIC_CONFIG, active: true }, { network: config.CELO_CONFIG, active: false }, { network: config.ARBITRUM_CONFIG, active: false }, + { network: config.BASE_CONFIG, active: false }, ]; const options = _options.map(o => ({ diff --git a/src/components/SuccessfulCreation.tsx b/src/components/SuccessfulCreation.tsx index 1fac591e8f..ad8d949371 100644 --- a/src/components/SuccessfulCreation.tsx +++ b/src/components/SuccessfulCreation.tsx @@ -86,7 +86,7 @@ const SuccessfulCreation = (props: IProps) => { animationData={CongratsAnimation} /> - + {formatMessage({ id: 'label.high_five' })} diff --git a/src/components/controller/general.ctrl.tsx b/src/components/controller/general.ctrl.tsx index ba52080bfe..d124405256 100644 --- a/src/components/controller/general.ctrl.tsx +++ b/src/components/controller/general.ctrl.tsx @@ -8,7 +8,7 @@ import { useAppDispatch, useAppSelector } from '@/features/hooks'; import { setShowWalletModal } from '@/features/modal/modal.slice'; import { fetchMainCategories, - fetchQFRounds, + fetchActiveQFRounds, } from '@/features/general/general.thunk'; const GeneralController = () => { @@ -22,8 +22,8 @@ const GeneralController = () => { useEffect(() => { dispatch(fetchMainCategories()); - dispatch(fetchQFRounds()); - }, [dispatch]); + dispatch(fetchActiveQFRounds()); + }, []); useEffect(() => { if (!router) return; diff --git a/src/components/menu/FilterMenu.tsx b/src/components/menu/FilterMenu.tsx index 8056168b4f..ab4db28ba2 100644 --- a/src/components/menu/FilterMenu.tsx +++ b/src/components/menu/FilterMenu.tsx @@ -57,6 +57,10 @@ const fundsFilter = [ label: 'Arbitrum', value: EProjectsFilter.ACCEPT_FUND_ON_ARBITRUM, }, + { + label: 'Base', + value: EProjectsFilter.ACCEPT_FUND_ON_BASE, + }, ]; fundsFilter.push({ diff --git a/src/components/modals/Boost/BoostedInnerModal.tsx b/src/components/modals/Boost/BoostedInnerModal.tsx index 0380f7f002..8ef1e12d67 100644 --- a/src/components/modals/Boost/BoostedInnerModal.tsx +++ b/src/components/modals/Boost/BoostedInnerModal.tsx @@ -36,7 +36,7 @@ const BoostedInnerModal: FC = ({ animationData={CongratsAnimation} /> - + {formatMessage({ id: 'label.project_boosted' })} diff --git a/src/components/modals/DonateWrongNetwork.tsx b/src/components/modals/DonateWrongNetwork.tsx index ddca94ef1d..dc1fe16c77 100644 --- a/src/components/modals/DonateWrongNetwork.tsx +++ b/src/components/modals/DonateWrongNetwork.tsx @@ -44,6 +44,7 @@ const networks = [ config.OPTIMISM_CONFIG, config.CLASSIC_CONFIG, config.SOLANA_CONFIG, + config.BASE_CONFIG, ]; export const DonateWrongNetwork: FC = props => { diff --git a/src/components/modals/GIVBackExplain.tsx b/src/components/modals/GIVBackExplain.tsx index d2c7cb1fb1..ad03c24040 100644 --- a/src/components/modals/GIVBackExplain.tsx +++ b/src/components/modals/GIVBackExplain.tsx @@ -6,8 +6,8 @@ import { brandColors, IconExternalLink, OutlineButton, - IconGIVBack, Flex, + IconGIVBack24, } from '@giveth/ui-design-system'; import styled from 'styled-components'; import { FC } from 'react'; @@ -25,7 +25,7 @@ export const GIVBackExplainModal: FC = ({ setShowModal }) => { - + {formatMessage({ id: 'label.why_dont_i_have_givbacks', diff --git a/src/components/modals/HarvestAll.tsx b/src/components/modals/HarvestAll.tsx index e55b39097b..5b1b382226 100644 --- a/src/components/modals/HarvestAll.tsx +++ b/src/components/modals/HarvestAll.tsx @@ -9,13 +9,13 @@ import React, { import { brandColors, Caption, - IconGIVBack, IconGIVFarm, IconGIVStream, IconHelpFilled16, Lead, P, Flex, + IconGIVBack24, } from '@giveth/ui-design-system'; import { useIntl } from 'react-intl'; import BigNumber from 'bignumber.js'; @@ -409,7 +409,7 @@ export const HarvestAllModal: FC<IHarvestAllModalProps> = ({ <BreakdownRow> <BreakdownTitle> <BreakdownIcon> - <IconGIVBack size={24} /> + <IconGIVBack24 /> </BreakdownIcon> <P>GIVbacks</P> </BreakdownTitle> diff --git a/src/components/modals/StakeLock/LockingBrief.tsx b/src/components/modals/StakeLock/LockingBrief.tsx index 21388f49e3..d397a97726 100644 --- a/src/components/modals/StakeLock/LockingBrief.tsx +++ b/src/components/modals/StakeLock/LockingBrief.tsx @@ -23,7 +23,9 @@ const LockingBrief: FC<ILockingBrief> = ({ const unlockDate = new Date(getUnlockDate(givpowerInfo, round)); return ( <BriefContainer> - <H5>{`You ${onLocking ? 'are locking' : 'locked'} `}</H5> + <H5 + id={`${onLocking ? 'givpower-locking' : 'givpower-locked'}`} + >{`You ${onLocking ? 'are locking' : 'locked'} `}</H5> <H5White weight={700}> {formatWeiHelper(amount.toString())} GIV </H5White> diff --git a/src/components/modals/StakeLock/StakeGIV.tsx b/src/components/modals/StakeLock/StakeGIV.tsx index 2d9c03241a..9b56358caf 100644 --- a/src/components/modals/StakeLock/StakeGIV.tsx +++ b/src/components/modals/StakeLock/StakeGIV.tsx @@ -31,9 +31,11 @@ import { useStakingPool } from '@/hooks/useStakingPool'; import { StakingAmountInput } from '@/components/AmountInput/StakingAmountInput'; import { StakeSteps } from './StakeSteps'; import { getGIVConfig } from '@/helpers/givpower'; -import type { - PoolStakingConfig, - SimplePoolStakingConfig, +import { + RegenPoolStakingConfig, + StakingType, + type PoolStakingConfig, + type SimplePoolStakingConfig, } from '@/types/config'; interface IStakeInnerModalProps { @@ -84,9 +86,22 @@ const StakeGIVInnerModal: FC<IStakeModalProps> = ({ const maxAmount = _maxAmount || 0n; const isSafeEnv = useIsSafeEnvironment(); - const { POOL_ADDRESS, LM_ADDRESS } = + const { POOL_ADDRESS, LM_ADDRESS, type } = poolStakingConfig as SimplePoolStakingConfig; + const { regenStreamType } = poolStakingConfig as RegenPoolStakingConfig; + + const isGIVpower = + type === StakingType.GIV_GARDEN_LM || + type === StakingType.GIV_UNIPOOL_LM; + + // preffix property for heading elements used by analytics + const idPropertyPreffix = regenStreamType + ? 'regenfarm' + : isGIVpower + ? 'givpower' + : ''; + const onApprove = async () => { if (amount === 0n) return; setStakeState(StakeState.APPROVING); @@ -236,7 +251,7 @@ const StakeGIVInnerModal: FC<IStakeModalProps> = ({ stakeState === StakeState.WRAPPING) && ( <> <BriefContainer> - <H5> + <H5 id={`${idPropertyPreffix}-staking`}> {formatMessage({ id: 'label.you_are_staking', })} @@ -287,7 +302,9 @@ const StakeGIVInnerModal: FC<IStakeModalProps> = ({ <StakeInnerModalContainer> <BriefContainer> <H5>Successful!</H5> - <H5White>You have staked</H5White> + <H5White id={`${idPropertyPreffix}-staked`}> + You have staked + </H5White> <H5White weight={700}> {formatWeiHelper(amount.toString())} GIV </H5White> diff --git a/src/components/project-card/ProjectCard.tsx b/src/components/project-card/ProjectCard.tsx index 6d3824a2fc..d2fbb29ac4 100644 --- a/src/components/project-card/ProjectCard.tsx +++ b/src/components/project-card/ProjectCard.tsx @@ -52,7 +52,7 @@ const ProjectCard = (props: IProjectCard) => { image, slug, adminUser, - sumDonationValueUsd, + totalDonations, sumDonationValueUsdForActiveQfRound, updatedAt, organization, @@ -172,7 +172,7 @@ const ProjectCard = (props: IProjectCard) => { {formatDonation( (activeStartedRound ? sumDonationValueUsdForActiveQfRound - : sumDonationValueUsd) || 0, + : totalDonations) || 0, '$', locale, )} @@ -190,7 +190,7 @@ const ProjectCard = (props: IProjectCard) => { }) + ' '} <span> {formatDonation( - sumDonationValueUsd || 0, + totalDonations || 0, '$', locale, )} diff --git a/src/components/views/archivedQFRounds/ArchivedQFBanner.tsx b/src/components/views/archivedQFRounds/ArchivedQFBanner.tsx deleted file mode 100644 index 3c76eb620c..0000000000 --- a/src/components/views/archivedQFRounds/ArchivedQFBanner.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import styled from 'styled-components'; -import Image from 'next/image'; - -export const ArchivedQFBanner = () => { - return ( - <BannerContainer> - <Image - src={'/images/banners/qf-banner.svg'} - style={{ objectFit: 'cover' }} - fill - alt='QF Banner' - /> - </BannerContainer> - ); -}; - -const BannerContainer = styled.div` - position: relative; - /* padding-top: 160px; - padding-bottom: 160px; */ - height: 500px; - img { - -webkit-user-drag: none; - -khtml-user-drag: none; - -moz-user-drag: none; - -o-user-drag: none; - user-drag: none; - } -`; diff --git a/src/components/views/archivedQFRounds/ArchivedQFRounds.view.tsx b/src/components/views/archivedQFRounds/ArchivedQFRounds.view.tsx index 30f48f7222..4a245f30a6 100644 --- a/src/components/views/archivedQFRounds/ArchivedQFRounds.view.tsx +++ b/src/components/views/archivedQFRounds/ArchivedQFRounds.view.tsx @@ -1,8 +1,7 @@ -import React, { useEffect, useState } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import { Container, Flex } from '@giveth/ui-design-system'; -import { ArchivedQFBanner } from './ArchivedQFBanner'; -import { EQFPageStatus, QFHeader } from './QFHeader'; +import { Container, Flex, OutlineButton } from '@giveth/ui-design-system'; +import { QFHeader } from './QFHeader'; import { client } from '@/apollo/apolloClient'; import { IArchivedQFRound } from '@/apollo/types/types'; import { ArchivedQFRoundsTable } from './ArchivedQFRoundsTable'; @@ -10,6 +9,10 @@ import { ArchivedQFRoundsMiddleBanner } from './ArchivedQFRoundsMiddleBanner'; import { FETCH_ARCHIVED_QF_ROUNDS } from '@/apollo/gql/gqlQF'; import { useArchivedQFRounds } from './archivedQfRounds.context'; import { EQFRoundsSortBy } from '@/apollo/types/gqlEnums'; +import { showToastError } from '@/lib/helpers'; +import { WrappedSpinner } from '@/components/Spinner'; +import { ArchivedQFRoundsSort } from './ArchivedQFRoundsSort'; +import { DefaultQFBanner } from '@/components/DefaultQFBanner'; enum EQfArchivedRoundsSort { allocatedFund = 'allocatedFund', @@ -23,61 +26,97 @@ enum EOrderDirection { DESC = 'DESC', } +const ITEMS_PER_PAGE = 10; + export const ArchivedQFRoundsView = () => { const [archivedQFRounds, setArchivedQFRounds] = useState< IArchivedQFRound[] >([]); + const [hasMore, setHasMore] = useState(true); + const [loading, setLoading] = useState(false); const { orderBy } = useArchivedQFRounds(); + const fetchQFRounds = useCallback( + async (isLoadMore: boolean = false, skip: number) => { + setLoading(true); + let field = EQfArchivedRoundsSort.beginDate; + let direction = EOrderDirection.DESC; + switch (orderBy) { + case EQFRoundsSortBy.MATCHING_POOL: + field = EQfArchivedRoundsSort.allocatedFund; + direction = EOrderDirection.DESC; + break; + case EQFRoundsSortBy.UNIQUE_DONORS: + field = EQfArchivedRoundsSort.uniqueDonors; + direction = EOrderDirection.DESC; + break; + case EQFRoundsSortBy.NEWEST: + field = EQfArchivedRoundsSort.beginDate; + direction = EOrderDirection.DESC; + break; + case EQFRoundsSortBy.OLDEST: + field = EQfArchivedRoundsSort.beginDate; + direction = EOrderDirection.ASC; + break; + default: + break; + } + try { + const { + data: { qfArchivedRounds }, + } = await client.query({ + query: FETCH_ARCHIVED_QF_ROUNDS, + fetchPolicy: 'network-only', + variables: { + limit: ITEMS_PER_PAGE, + skip, + orderBy: { + field, + direction, + }, + }, + }); + if (qfArchivedRounds.length < ITEMS_PER_PAGE) { + setHasMore(false); + } + setArchivedQFRounds(prev => { + return isLoadMore + ? [...prev, ...qfArchivedRounds] + : qfArchivedRounds; + }); + } catch (error) { + showToastError(error); + } finally { + setLoading(false); + } + }, + [orderBy], + ); + useEffect(() => { - let field = EQfArchivedRoundsSort.beginDate; - let direction = EOrderDirection.DESC; - switch (orderBy) { - case EQFRoundsSortBy.MATCHING_POOL: - field = EQfArchivedRoundsSort.allocatedFund; - direction = EOrderDirection.DESC; - break; - case EQFRoundsSortBy.UNIQUE_DONORS: - field = EQfArchivedRoundsSort.uniqueDonors; - direction = EOrderDirection.DESC; - break; - case EQFRoundsSortBy.NEWEST: - field = EQfArchivedRoundsSort.beginDate; - direction = EOrderDirection.DESC; - break; - case EQFRoundsSortBy.OLDEST: - field = EQfArchivedRoundsSort.beginDate; - direction = EOrderDirection.ASC; - break; - default: - break; - } + if (loading) return; + fetchQFRounds(false, 0); + }, [fetchQFRounds]); + + const loadMore = () => { + fetchQFRounds(true, archivedQFRounds.length); + }; - const fetchQFRounds = async () => { - const { - data: { qfArchivedRounds }, - } = await client.query({ - query: FETCH_ARCHIVED_QF_ROUNDS, - fetchPolicy: 'network-only', - variables: { - orderBy: { - field, - direction, - }, - }, - }); - setArchivedQFRounds(qfArchivedRounds); - }; - fetchQFRounds(); - }, [orderBy]); return ( <Wrapper> - <ArchivedQFBanner /> + <DefaultQFBanner /> <Container> - <QFHeader status={EQFPageStatus.ARCHIVED} /> + <HeaderWrapper gap='24px' $justifyContent='space-between'> + <QFHeader /> + <ArchivedQFRoundsSort /> + </HeaderWrapper> + <ArchivedQFRoundsTable archivedQFRounds={archivedQFRounds.slice(0, 5)} /> + {archivedQFRounds.length == 0 && loading && ( + <WrappedSpinner size={100} /> + )} </Container> <ArchivedQFRoundsMiddleBanner /> <Container> @@ -88,6 +127,15 @@ export const ArchivedQFRoundsView = () => { )} /> </Container> + {archivedQFRounds.length > 0 && loading ? ( + <WrappedSpinner size={100} /> + ) : hasMore ? ( + <LoadMoreButton + buttonType='texty-primary' + onClick={loadMore} + label='Load More' + /> + ) : null} </Wrapper> ); }; @@ -96,3 +144,11 @@ const Wrapper = styled(Flex)` flex-direction: column; gap: 40px; `; + +const HeaderWrapper = styled(Flex)` + margin-bottom: 24px; +`; + +const LoadMoreButton = styled(OutlineButton)` + margin: 20px auto; +`; diff --git a/src/components/views/archivedQFRounds/ArchivedQFRoundsMiddleBanner.tsx b/src/components/views/archivedQFRounds/ArchivedQFRoundsMiddleBanner.tsx index 5f6ce7897b..c4ded50a6a 100644 --- a/src/components/views/archivedQFRounds/ArchivedQFRoundsMiddleBanner.tsx +++ b/src/components/views/archivedQFRounds/ArchivedQFRoundsMiddleBanner.tsx @@ -11,12 +11,12 @@ export const ArchivedQFRoundsMiddleBanner = () => { <Container> <Title weight={700} color={semanticColors.jade[700]}> {formatMessage({ - id: 'component.qf_middle_banner.title', + id: 'label.archived_qf_rounds', })} {formatMessage({ - id: 'component.qf_middle_banner.desc', + id: 'component.archived_qf_middle_banner.desc', })} diff --git a/src/components/views/archivedQFRounds/ArchivedQFRoundsTable.tsx b/src/components/views/archivedQFRounds/ArchivedQFRoundsTable.tsx index 24c94e7bfa..79cc2398f7 100644 --- a/src/components/views/archivedQFRounds/ArchivedQFRoundsTable.tsx +++ b/src/components/views/archivedQFRounds/ArchivedQFRoundsTable.tsx @@ -28,10 +28,9 @@ export const ArchivedQFRoundsTable: FC = ({ Funding Round Matching Pool - Total Donations + Donations (USD value) Unique Donors - Round started - Round Ended + Round Duration {archivedQFRounds.map((round, index) => ( @@ -48,8 +47,10 @@ export const ArchivedQFRoundsTable: FC = ({

{formatDonation(round.totalDonations, '$') || 0}

{round.uniqueDonors}

-

{formatDate(new Date(round.beginDate))}

-

{formatDate(new Date(round.endDate))}

+ +

{formatDate(new Date(round.beginDate))}

+

{formatDate(new Date(round.endDate))}

+

span:first-child { - padding-left: 16px; border-radius: 16px 0 0 16px; } & > span { - padding: 16px 0; + padding: 16px; background-color: ${neutralColors.gray[200]}; margin-bottom: 16px; } & > span:last-child { - padding-right: 16px; border-radius: 0 16px 16px 0; } `; @@ -107,7 +106,7 @@ const TR = styled.div` padding-left: 8px; } & > div { - padding: 16px 0; + padding: 16px; border-bottom: 1px solid ${neutralColors.gray[300]}; margin-bottom: 16px; } diff --git a/src/components/views/archivedQFRounds/QFHeader.tsx b/src/components/views/archivedQFRounds/QFHeader.tsx index bbfbef6f97..0a265a8944 100644 --- a/src/components/views/archivedQFRounds/QFHeader.tsx +++ b/src/components/views/archivedQFRounds/QFHeader.tsx @@ -1,39 +1,33 @@ import { Flex, H6, neutralColors } from '@giveth/ui-design-system'; import Link from 'next/link'; -import { type FC } from 'react'; import { useIntl } from 'react-intl'; import styled from 'styled-components'; +import { useRouter } from 'next/router'; import Routes from '@/lib/constants/Routes'; -import { ArchivedQFRoundsSort } from './ArchivedQFRoundsSort'; -export enum EQFPageStatus { +enum EQFPageStatus { ACTIVE = 'label.active_round', ARCHIVED = 'label.archived_rounds', } -interface IQFHeaderProps { - status: EQFPageStatus; -} - -export const QFHeader: FC = ({ status }) => { +export const QFHeader = () => { const { formatMessage } = useIntl(); + const { pathname } = useRouter(); + const isArchivedPath = pathname.startsWith(Routes.QFArchived); return ( - - - - - {formatMessage({ id: EQFPageStatus.ACTIVE })} - - - - - {formatMessage({ id: EQFPageStatus.ARCHIVED })} - - - - - + + + + {formatMessage({ id: EQFPageStatus.ACTIVE })} + + + + + {formatMessage({ id: EQFPageStatus.ARCHIVED })} + + + ); }; @@ -48,8 +42,3 @@ const Item = styled(H6)<{ active: boolean }>` border-bottom-width: 4px; } `; - -const Wrapper = styled(Flex)` - margin-bottom: 24px; - justify-content: space-between; -`; diff --git a/src/components/views/donate/CryptoDonation.tsx b/src/components/views/donate/CryptoDonation.tsx index f64901bcb8..b718c34b55 100644 --- a/src/components/views/donate/CryptoDonation.tsx +++ b/src/components/views/donate/CryptoDonation.tsx @@ -47,7 +47,6 @@ import { getERC20Info } from '@/lib/contracts'; import GIVBackToast from '@/components/views/donate/GIVBackToast'; import { DonateWrongNetwork } from '@/components/modals/DonateWrongNetwork'; import { useAppDispatch, useAppSelector } from '@/features/hooks'; -import usePurpleList from '@/hooks/usePurpleList'; import DonateToGiveth from '@/components/views/donate/DonateToGiveth'; import TotalDonation from '@/components/views/donate/TotalDonation'; import SaveGasFees from '@/components/views/donate/SaveGasFees'; @@ -77,8 +76,6 @@ const CryptoDonation: FC = () => { const { formatMessage } = useIntl(); const { isSignedIn } = useAppSelector(state => state.user); - const isPurpleListed = usePurpleList(); - const { project, hasActiveQFRound } = useDonateData(); const dispatch = useAppDispatch(); @@ -94,6 +91,7 @@ const CryptoDonation: FC = () => { const { supportCustomTokens, label: orgLabel } = organization || {}; const isActive = status?.name === EProjectStatus.ACTIVE; const noDonationSplit = Number(projectId!) === config.GIVETH_PROJECT_ID; + const [selectedToken, setSelectedToken] = useState(); const [selectedTokenBalance, setSelectedTokenBalance] = useState(0n); const [customInput, setCustomInput] = useState(); @@ -518,7 +516,6 @@ const CryptoDonation: FC = () => { )} {!noDonationSplit ? ( diff --git a/src/components/views/donate/DonateIndex.tsx b/src/components/views/donate/DonateIndex.tsx index bbc5bb1b55..e651b42c15 100644 --- a/src/components/views/donate/DonateIndex.tsx +++ b/src/components/views/donate/DonateIndex.tsx @@ -4,7 +4,6 @@ import { Col, Container, IconDonation24, - mediaQueries, neutralColors, Row, semanticColors, @@ -55,15 +54,17 @@ const DonateIndex: FC = () => { return successDonation ? ( <> - + - + ) : ( <> {!isSafeEnv && hasActiveQFRound && !isOnSolana && ( - + + + )} {/* */} @@ -111,6 +112,10 @@ const DonateIndex: FC = () => { ); }; +const PassportWrapper = styled.div` + margin-top: 100px; +`; + const AlreadyDonatedWrapper = styled(Flex)` margin-bottom: 16px; padding: 12px 16px; @@ -122,17 +127,18 @@ const AlreadyDonatedWrapper = styled(Flex)` align-items: center; `; -const DonateContainer = styled(Container)` +const SuccessContainer = styled(Container)` text-align: center; - padding-top: 128px; + padding-top: 110px; padding-bottom: 64px; position: relative; `; -const Wrapper = styled.div` - max-width: 1052px; - padding: 64px 0; - margin: 0 auto; +const DonateContainer = styled(Container)` + text-align: center; + padding-top: 20px; + padding-bottom: 64px; + position: relative; `; const InfoWrapper = styled.div` @@ -152,29 +158,4 @@ const ImageWrapper = styled.div` overflow: hidden; `; -const Sections = styled.div` - height: 100%; - ${mediaQueries.tablet} { - display: grid; - grid-template-columns: repeat(2, minmax(500px, 1fr)); - grid-auto-rows: minmax(100px, auto); - } - ${mediaQueries.mobileL} { - grid-template-columns: repeat(2, minmax(100px, 1fr)); - padding: 0 40px; - } -`; - -const Right = styled.div` - z-index: 1; - background: white; - text-align: left; - padding: 32px; - min-height: 620px; - border-radius: 16px; - ${mediaQueries.tablet} { - border-radius: 0 16px 16px 0; - } -`; - export default DonateIndex; diff --git a/src/components/views/donate/DonateModal.tsx b/src/components/views/donate/DonateModal.tsx index 5a3a3a4966..3e028157f3 100644 --- a/src/components/views/donate/DonateModal.tsx +++ b/src/components/views/donate/DonateModal.tsx @@ -1,4 +1,4 @@ -import React, { FC, useState } from 'react'; +import React, { FC, useEffect, useState } from 'react'; import styled from 'styled-components'; import { brandColors, @@ -6,6 +6,7 @@ import { Lead, neutralColors, Button, + FlexCenter, } from '@giveth/ui-design-system'; import { useIntl } from 'react-intl'; import { Chain } from 'viem'; @@ -32,10 +33,12 @@ import { TxHashWithChainType, useDonateData } from '@/context/donate.context'; import { useCreateEvmDonation } from '@/hooks/useCreateEvmDonation'; import { useGeneralWallet } from '@/providers/generalWalletProvider'; import { ChainType } from '@/types/config'; -import { IWalletAddress } from '@/apollo/types/types'; +import { IProject, IWalletAddress } from '@/apollo/types/types'; import { useCreateSolanaDonation } from '@/hooks/useCreateSolanaDonation'; import { useTokenPrice } from '@/hooks/useTokenPrice'; import { calcDonationShare } from '@/components/views/donate/helpers'; +import { Spinner } from '@/components/Spinner'; +import { FETCH_GIVETH_PROJECT_BY_ID } from '@/apollo/gql/gqlProjects'; interface IDonateModalProps extends IModal { token: IProjectAcceptedToken; @@ -85,24 +88,49 @@ const DonateModal: FC = props => { const [donating, setDonating] = useState(false); const [secondTxStatus, setSecondTxStatus] = useState(); const [processFinished, setProcessFinished] = useState(false); + const [isLoadingGivethAddress, setIsLoadingGivethAddress] = + useState(isDonatingToGiveth); + const [givethProject, setGivethProject] = useState(); const [failedModalType, setFailedModalType] = useState(); + useEffect(() => { + const fetchGivethProject = async () => { + try { + const { data } = await client.query({ + query: FETCH_GIVETH_PROJECT_BY_ID, + variables: { id: config.GIVETH_PROJECT_ID }, + fetchPolicy: 'cache-first', + }); + setGivethProject(data.projectById); + setIsLoadingGivethAddress(false); + } catch (e) { + setIsLoadingGivethAddress(false); + showToastError('Failed to fetch Giveth wallet address'); + console.log('Failed to fetch Giveth wallet address', e); + closeModal(); + } + }; + if (isDonatingToGiveth) fetchGivethProject().then(); + }, []); + const tokenPrice = useTokenPrice(token); const chainvineReferred = getWithExpiry(StorageLabel.CHAINVINEREFERRED); - const { title, addresses, givethAddresses } = project || {}; + const { title, addresses } = project || {}; const projectWalletAddress = findMatchingWalletAddress( addresses, chainId, walletChainType, ); - const givethWalletAddress = findMatchingWalletAddress( - givethAddresses, - chainId, - walletChainType, - ); + const givethWalletAddress = () => { + return findMatchingWalletAddress( + givethProject?.addresses, + chainId, + walletChainType, + ); + }; const { projectDonation, givethDonation } = calcDonationShare( amount, @@ -166,12 +194,10 @@ const DonateModal: FC = props => { token, setFailedModalType, }; - if (!projectWalletAddress || !givethWalletAddress) { + if (!projectWalletAddress) { setDonating(false); return showToastError( - `${ - !projectWalletAddress ? 'Project' : 'Giveth' - } wallet address for the destination network doesn't exist`, + "Project wallet address for the destination network doesn't exist", ); } createFirstDonation({ @@ -192,7 +218,7 @@ const DonateModal: FC = props => { if (isDonatingToGiveth) { createSecondDonation({ ...txProps, - walletAddress: givethWalletAddress, + walletAddress: givethWalletAddress()!, amount: givethDonation, projectId: config.GIVETH_PROJECT_ID, setFailedModalType, @@ -229,6 +255,13 @@ const DonateModal: FC = props => { }); }; + if (isLoadingGivethAddress) + return ( + + + + ); + return ( <> = props => { ); }; +const Loading = styled(FlexCenter)` + position: fixed; + top: 0; + left: 0; + z-index: 1000; + height: 100%; + width: 100%; + background-color: gray; + transition: opacity 0.3s ease-in-out; + opacity: 0.9; +`; + const findMatchingWalletAddress = ( addresses: IWalletAddress[] = [], chainId: number, diff --git a/src/components/views/donate/DonatePageProjectDescription.tsx b/src/components/views/donate/DonatePageProjectDescription.tsx index 784bcae1be..d209568650 100644 --- a/src/components/views/donate/DonatePageProjectDescription.tsx +++ b/src/components/views/donate/DonatePageProjectDescription.tsx @@ -30,7 +30,7 @@ export const DonatePageProjectDescription: FC< > = ({ projectData, showRaised = true }) => { const { formatMessage, locale } = useIntl(); const { - sumDonationValueUsd, + totalDonations, slug, title, descriptionSummary, @@ -64,7 +64,7 @@ export const DonatePageProjectDescription: FC< {showRaised && (

{formatMessage({ id: 'label.raised' })}:{' '} - {formatDonation(sumDonationValueUsd || 0, '$', locale)} + {formatDonation(totalDonations || 0, '$', locale)}

)} {descriptionSummary} diff --git a/src/components/views/donate/EstimatedMatchingToast.tsx b/src/components/views/donate/EstimatedMatchingToast.tsx index 8a3de3ad76..2cce32a3b9 100644 --- a/src/components/views/donate/EstimatedMatchingToast.tsx +++ b/src/components/views/donate/EstimatedMatchingToast.tsx @@ -13,7 +13,7 @@ import { useIntl } from 'react-intl'; import Divider from '@/components/Divider'; import { TooltipContent } from '@/components/modals/HarvestAll.sc'; import { IconWithTooltip } from '@/components/IconWithToolTip'; -import { IDonationProject } from '@/apollo/types/types'; +import { IProject } from '@/apollo/types/types'; import { calculateEstimatedMatchingWithDonationAmount, getActiveRound, @@ -23,7 +23,7 @@ import { formatDonation } from '@/helpers/number'; import { useTokenPrice } from '@/hooks/useTokenPrice'; interface IEstimatedMatchingToast { - projectData: IDonationProject; + projectData: IProject; token?: IProjectAcceptedToken; amountTyped?: number; } diff --git a/src/components/views/donate/GIVBackToast.tsx b/src/components/views/donate/GIVBackToast.tsx index df20b0d142..9a06e73322 100644 --- a/src/components/views/donate/GIVBackToast.tsx +++ b/src/components/views/donate/GIVBackToast.tsx @@ -4,17 +4,19 @@ import { useIntl } from 'react-intl'; import links from '@/lib/constants/links'; import ExternalLink from '@/components/ExternalLink'; import InlineToast, { EToastType } from '@/components/toasts/InlineToast'; +import usePurpleList from '@/hooks/usePurpleList'; const GIVBackToast = (props: { projectEligible?: boolean; tokenEligible?: boolean; - userEligible?: boolean; + className?: string; }) => { - const { projectEligible, tokenEligible, userEligible } = props; + const { projectEligible, tokenEligible, className } = props; + const isPurpleListed = usePurpleList(); const { formatMessage } = useIntl(); let message: JSX.Element | string, type = EToastType.Warning; - if (!userEligible) { + if (isPurpleListed) { message = formatMessage({ id: 'label.your_current_wallet_is_associated_with_a_giveth_project', }); @@ -43,7 +45,7 @@ const GIVBackToast = (props: { } return ( - + { const { project, selectedToken, tokenStreams } = useDonateData(); const isGivethProject = Number(project.id!) === config.GIVETH_PROJECT_ID; const [amount, setAmount] = useState(0n); + const [perMonthAmount, setPerMonthAmount] = useState(0n); const [isUpdating, setIsUpdating] = useState(false); - const [percentage, setPercentage] = useState(0); const [donationToGiveth, setDonationToGiveth] = useState( isGivethProject ? 0 : 5, ); @@ -135,18 +136,11 @@ export const RecurringDonationCard = () => { const underlyingToken = selectedToken?.token.underlyingToken; - const totalPerMonth = - BigInt( - new BigNumber((amount || 0n).toString()) - .multipliedBy(percentage) - .toFixed(0), - ) / 100n; - // total means project + giveth - const totalPerSec = totalPerMonth / ONE_MONTH_SECONDS; + const totalPerSec = perMonthAmount / ONE_MONTH_SECONDS; const projectPerMonth = - (totalPerMonth * BigInt(100 - donationToGiveth)) / 100n; - const givethPerMonth = totalPerMonth - projectPerMonth; + (perMonthAmount * BigInt(100 - donationToGiveth)) / 100n; + const givethPerMonth = perMonthAmount - projectPerMonth; const tokenBalance = balance?.value; const tokenStream = tokenStreams[selectedToken?.token.id || '']; @@ -173,8 +167,9 @@ export const RecurringDonationCard = () => { ? semanticColors.punch : brandColors.giv; + const projectIsGivBackEligible = !!project.verified; + const handleDonate = () => { - console.log('isSignedIn', isSignedIn); if (anchorContractAddress) { if (isSignedIn) { setShowRecurringDonationModal(true); @@ -209,17 +204,12 @@ export const RecurringDonationCard = () => { if (_userStreamOnSelectedToken) { setUserStreamOnSelectedToken(_userStreamOnSelectedToken); - const _percentage = BigNumber( - ( - BigInt(_userStreamOnSelectedToken.currentFlowRate) * - ONE_MONTH_SECONDS * - 100n - ).toString(), - ).dividedBy(selectedToken.balance.toString()); - setPercentage(parseFloat(_percentage.toString())); + setPerMonthAmount( + BigInt(_userStreamOnSelectedToken.currentFlowRate) * + ONE_MONTH_SECONDS, + ); } else { setUserStreamOnSelectedToken(undefined); - //Please don't make percentage zero here, it will reset the slider to 0 } } catch (error) { showToastError(error); @@ -230,10 +220,14 @@ export const RecurringDonationCard = () => { selectedToken === undefined || tokenBalance === undefined || amount === 0n || - percentage === 0 || + perMonthAmount === 0n || isTotalStreamExceed || amount > tokenBalance; + const percentage = amount + ? Number((perMonthAmount * 1000n) / amount) / 10 + : 0; + return ( <> @@ -372,7 +366,7 @@ export const RecurringDonationCard = () => { id: 'label.amount_to_donate_monthly', })} </Caption> - <SliderWrapper> + <Flex gap='16px' $alignItems='center'> <StyledSlider min={0} max={100} @@ -389,15 +383,39 @@ export const RecurringDonationCard = () => { }, }} onChange={(value: any) => { - const _value = Array.isArray(value) - ? value[0] - : value; - setPercentage(mapValue(_value)); + const _value = value as number; + const _percentage = mapValue(_value); + const _perMonthAmount = + BigInt( + new BigNumber( + (amount || 0n).toString(), + ) + .multipliedBy(_percentage) + .toFixed(0), + ) / 100n; + setPerMonthAmount(_perMonthAmount); }} - value={mapValueInverse(percentage)} + value={mapValueInverse(percentage.valueOf())} disabled={amount === 0n} /> - </SliderWrapper> + <InputSlider + amount={perMonthAmount} + setAmount={setPerMonthAmount} + maxAmount={amount} + decimals={selectedToken?.token.decimals || 18} + disabled={selectedToken === undefined} + className={ + perMonthAmount > amount ? 'error' : '' + } + /> + </Flex> + {perMonthAmount > amount && ( + <RecurringMessage> + {formatMessage({ + id: 'label.recurring_donation_maximum', + })} + </RecurringMessage> + )} <Flex $justifyContent='space-between'> <Flex gap='4px'> <Caption> @@ -409,10 +427,10 @@ export const RecurringDonationCard = () => { </Flex> <Flex gap='4px'> <Caption $medium> - {amount !== 0n && percentage !== 0 + {amount !== 0n && perMonthAmount !== 0n ? limitFraction( formatUnits( - totalPerMonth, + perMonthAmount, selectedToken?.token .decimals || 18, ), @@ -545,6 +563,12 @@ export const RecurringDonationCard = () => { </Flex> )} </RecurringSection> + {selectedToken && ( + <GIVBackToastStyled + projectEligible={projectIsGivBackEligible} + tokenEligible={true} + /> + )} {userStreamOnSelectedToken ? ( isUpdating ? ( <ActionButton @@ -586,7 +610,7 @@ export const RecurringDonationCard = () => { </Caption> <Flex gap='4px'> <Caption> - {amount !== 0n && percentage !== 0 + {amount !== 0n && perMonthAmount !== 0n ? limitFraction( formatUnits( projectPerMonth, @@ -621,7 +645,8 @@ export const RecurringDonationCard = () => { </Caption> <Flex gap='4px'> <Caption> - {amount !== 0n && percentage !== 0 + {amount !== 0n && + perMonthAmount !== 0n ? limitFraction( formatUnits( givethPerMonth, @@ -650,10 +675,10 @@ export const RecurringDonationCard = () => { </Caption> <Flex gap='4px'> <Caption $medium> - {amount !== 0n && percentage !== 0 + {amount !== 0n && perMonthAmount !== 0n ? limitFraction( formatUnits( - totalPerMonth, + perMonthAmount, selectedToken?.token .decimals || 18, ), @@ -714,7 +739,7 @@ export const RecurringDonationCard = () => { isGivethProject || isUpdating ? 0 : donationToGiveth } amount={amount} - percentage={percentage} + perMonthAmount={perMonthAmount} isUpdating={isUpdating} anonymous={anonymous} /> @@ -767,13 +792,6 @@ const RecurringSection = styled(Flex)` text-align: left; `; -// const RecurringSectionTitle = styled(B)` -// width: 100%; -// padding-bottom: 8px; -// border-bottom: 1px solid ${neutralColors.gray[300]}; -// text-align: left; -// `; - export const SelectTokenWrapper = styled(Flex)` cursor: pointer; gap: 16px; @@ -808,6 +826,14 @@ const Input = styled(AmountInput)` } `; +const RecurringMessage = styled(P)` + font-size: 12px; + font-style: normal; + font-weight: 400; + line-height: 18px; + color: #e6492d; +`; + export const IconWrapper = styled.div` cursor: pointer; color: ${brandColors.giv[500]}; @@ -820,13 +846,27 @@ const GLinkStyled = styled(GLink)` } `; -const SliderWrapper = styled.div` - width: 100%; - position: relative; -`; - const StyledSlider = styled(Slider)``; +const InputSlider = styled(AmountInput)` + width: 27%; + border: 2px solid ${neutralColors.gray[300]}; + border-radius: 8px; + padding: 4px; + #amount-input { + border: none; + flex: 1; + font-family: Red Hat Text; + font-size: 16px; + font-style: normal; + line-height: 150%; /* 24px */ + width: 100%; + } + &&.error { + border-color: #e6492d; + } +`; + const GivethSection = styled(Flex)` flex-direction: column; gap: 24px; @@ -865,3 +905,11 @@ const TotalMonthlyStream = styled.b` const ManageCaption = styled(Caption)` color: ${brandColors.giv[500]}; `; + +const GIVBackToastStyled = styled(GIVBackToast)` + margin: 0; + width: 100%; + & > div { + margin: 0; + } +`; diff --git a/src/components/views/donate/RecurringDonationModal/RecurringDonationModal.tsx b/src/components/views/donate/RecurringDonationModal/RecurringDonationModal.tsx index 89623b0196..bdc5bf62d6 100644 --- a/src/components/views/donate/RecurringDonationModal/RecurringDonationModal.tsx +++ b/src/components/views/donate/RecurringDonationModal/RecurringDonationModal.tsx @@ -9,7 +9,6 @@ import styled from 'styled-components'; import { Framework, type Operation } from '@superfluid-finance/sdk-core'; import { useAccount } from 'wagmi'; import { useIntl } from 'react-intl'; -import BigNumber from 'bignumber.js'; import { formatUnits } from 'viem'; import { Modal } from '@/components/modals/Modal'; import { useModalAnimation } from '@/hooks/useModalAnimation'; @@ -44,7 +43,7 @@ import { ensureCorrectNetwork } from '@/helpers/network'; interface IRecurringDonationModalProps extends IModal { donationToGiveth: number; amount: bigint; - percentage: number; + perMonthAmount: bigint; isUpdating?: boolean; anonymous: boolean; } @@ -120,7 +119,7 @@ const RecurringDonationInnerModal: FC<IRecurringDonationInnerModalProps> = ({ step, setStep, amount, - percentage, + perMonthAmount, donationToGiveth, setShowModal, isUpdating, @@ -240,7 +239,7 @@ const RecurringDonationInnerModal: FC<IRecurringDonationInnerModalProps> = ({ } const _flowRate = - (totalPerMonth * BigInt(100 - donationToGiveth)) / + (perMonthAmount * BigInt(100 - donationToGiveth)) / 100n / ONE_MONTH_SECONDS; @@ -273,7 +272,7 @@ const RecurringDonationInnerModal: FC<IRecurringDonationInnerModalProps> = ({ } const _newFlowRate = - (totalPerMonth * BigInt(donationToGiveth)) / + (perMonthAmount * BigInt(donationToGiveth)) / 100n / ONE_MONTH_SECONDS; @@ -489,15 +488,9 @@ const RecurringDonationInnerModal: FC<IRecurringDonationInnerModalProps> = ({ } }; - const totalPerMonth = - BigInt( - new BigNumber((amount || 0n).toString()) - .multipliedBy(percentage) - .toFixed(0), - ) / 100n; const projectPerMonth = - (totalPerMonth * BigInt(100 - donationToGiveth)) / 100n; - const givethPerMonth = totalPerMonth - projectPerMonth; + (perMonthAmount * BigInt(100 - donationToGiveth)) / 100n; + const givethPerMonth = perMonthAmount - projectPerMonth; return ( <Wrapper> @@ -530,7 +523,7 @@ const RecurringDonationInnerModal: FC<IRecurringDonationInnerModalProps> = ({ </Items> <RunOutInfo superTokenBalance={amount} - streamFlowRatePerMonth={totalPerMonth} + streamFlowRatePerMonth={perMonthAmount} symbol={selectedToken?.token.symbol || ''} /> <ActionButton diff --git a/src/components/views/donate/SelectTokenModal/SelectTokenModal.tsx b/src/components/views/donate/SelectTokenModal/SelectTokenModal.tsx index 0b91d935ff..42719c8ba9 100644 --- a/src/components/views/donate/SelectTokenModal/SelectTokenModal.tsx +++ b/src/components/views/donate/SelectTokenModal/SelectTokenModal.tsx @@ -1,13 +1,13 @@ import styled from 'styled-components'; import { Caption, - IconGIVBack, SublineBold, brandColors, mediaQueries, neutralColors, Flex, P, + IconGIVBack24, } from '@giveth/ui-design-system'; import { useState, type FC, useEffect } from 'react'; import { useAccount } from 'wagmi'; @@ -243,7 +243,7 @@ const SelectTokenInnerModal: FC<ISelectTokenModalProps> = ({ </Wrapper> <GIVbackWrapper> <Flex gap='8px' $alignItems='center'> - <IconGIVBack size={24} color={brandColors.giv[500]} /> + <IconGIVBack24 color={brandColors.giv[500]} /> <SublineBold> {formatMessage({ id: 'label.givbacks_eligible_tokens', diff --git a/src/components/views/donate/SuccessView.tsx b/src/components/views/donate/SuccessView.tsx index 59d655a65e..b84a80d659 100644 --- a/src/components/views/donate/SuccessView.tsx +++ b/src/components/views/donate/SuccessView.tsx @@ -73,11 +73,12 @@ export const SuccessView: FC = () => { networkId && activeStartedRound?.eligibleNetworks?.includes(networkId); useEffect(() => { + if (!hasMultipleTxs) return; client .query({ query: FETCH_GIVETH_PROJECT_BY_ID, variables: { id: config.GIVETH_PROJECT_ID }, - fetchPolicy: 'no-cache', + fetchPolicy: 'cache-first', }) .then((res: IFetchGivethProjectGQL) => setGivethSlug(res.data.projectById.slug), @@ -105,7 +106,7 @@ export const SuccessView: FC = () => { <Col xs={12} lg={6}> <RightSectionWrapper> <div> - <GiverH4 weight={700}> + <GiverH4 id='donation-success' weight={700}> {formatMessage({ id: 'label.youre_giver_now' })} </GiverH4> <br /> diff --git a/src/components/views/donate/TokenIcon/TokenIconWithGIVBack.tsx b/src/components/views/donate/TokenIcon/TokenIconWithGIVBack.tsx index a80339d616..9c6027d29d 100644 --- a/src/components/views/donate/TokenIcon/TokenIconWithGIVBack.tsx +++ b/src/components/views/donate/TokenIcon/TokenIconWithGIVBack.tsx @@ -27,7 +27,7 @@ export const TokenIconWithGIVBack: FC<ITokenIconWithGIVBackProps> = ({ {isSuperToken && <SecondGreenDot />} {showGiveBack && ( <GIVBackBadge> - <IconGIVBack16 size={16} color={brandColors.giv[500]} /> + <IconGIVBack16 color={brandColors.giv[500]} /> </GIVBackBadge> )} </TokenIconWrapper> diff --git a/src/components/views/donate/TokenPicker.tsx b/src/components/views/donate/TokenPicker.tsx index 5537c949b5..937adc8477 100644 --- a/src/components/views/donate/TokenPicker.tsx +++ b/src/components/views/donate/TokenPicker.tsx @@ -4,7 +4,6 @@ import { P, brandColors, Caption, - IconGIVBack, IconCheck, B, IconCaretUp, @@ -12,6 +11,7 @@ import { IconSearch, IconX, FlexCenter, + IconGIVBack24, } from '@giveth/ui-design-system'; import styled from 'styled-components'; import { useIntl } from 'react-intl'; @@ -49,7 +49,7 @@ const MenuList = (props: MenuListProps<IProjectAcceptedToken, false>) => { <components.MenuList {...props}> {projectVerified && ( <GivBackIconContainer> - <IconGIVBack size={24} color={brandColors.giv[500]} /> + <IconGIVBack24 color={brandColors.giv[500]} /> <Caption> {formatMessage({ id: 'label.givbacks_eligible_tokens', @@ -75,7 +75,7 @@ const Option = ({ ...props }: OptionProps<IProjectAcceptedToken, false>) => { {name} ({symbol}){' '} </B> {isGivbackEligible && projectVerified && ( - <IconGIVBack size={24} color={brandColors.giv[500]} /> + <IconGIVBack24 color={brandColors.giv[500]} /> )} </RowContainer> {props.isSelected && <IconCheck color={brandColors.giv[500]} />} diff --git a/src/components/views/homepage/aboutGiveconomy/index.tsx b/src/components/views/homepage/aboutGiveconomy/index.tsx index 3693005b24..5bc00303b0 100644 --- a/src/components/views/homepage/aboutGiveconomy/index.tsx +++ b/src/components/views/homepage/aboutGiveconomy/index.tsx @@ -5,11 +5,11 @@ import { Lead, neutralColors, IconChevronRight16, - IconGIVBack, IconRocketInSpace, IconFarm, Container, Flex, + IconGIVBack64, } from '@giveth/ui-design-system'; import styled from 'styled-components'; import { useIntl } from 'react-intl'; @@ -51,8 +51,7 @@ const AboutGiveconomy = () => { })} - diff --git a/src/components/views/project/ProjectGIVbackToast.tsx b/src/components/views/project/ProjectGIVbackToast.tsx index 40bb81f196..7623ae3b7b 100644 --- a/src/components/views/project/ProjectGIVbackToast.tsx +++ b/src/components/views/project/ProjectGIVbackToast.tsx @@ -6,7 +6,6 @@ import { IconChevronRight, IconDeactivated24, IconDiscord18, - IconGIVBack, IconPublish24, IconRocketInSpace16, IconSunrise16, @@ -17,6 +16,7 @@ import { P, semanticColors, Flex, + IconGIVBack24, } from '@giveth/ui-design-system'; import { useIntl } from 'react-intl'; import { useEffect, useState } from 'react'; @@ -78,7 +78,7 @@ const ProjectGIVbackToast = () => { const useIntlTitle = 'project.givback_toast.title.'; const useIntlDescription = 'project.givback_toast.description.'; - let icon = ; + let icon = ; let link = links.GIVBACK_DOC; let title = ''; diff --git a/src/components/views/project/projectActionCard/DonationSection.tsx b/src/components/views/project/projectActionCard/DonationSection.tsx index 1ed6a48186..aa7d41e4f2 100644 --- a/src/components/views/project/projectActionCard/DonationSection.tsx +++ b/src/components/views/project/projectActionCard/DonationSection.tsx @@ -25,19 +25,19 @@ interface IDonateSectionProps { export const DonateSection: FC = ({ projectData }) => { const { formatMessage, locale } = useIntl(); - const { sumDonationValueUsd } = projectData || {}; + const { totalDonations } = projectData || {}; const isMobile = !useMediaQuery(device.tablet); return ( - {sumDonationValueUsd && sumDonationValueUsd !== 0 ? ( + {totalDonations && totalDonations !== 0 ? ( {isMobile &&
} {formatMessage({ id: 'label.total_amount_raised' })} - {formatDonation(sumDonationValueUsd || 0, '$', locale)} + {formatDonation(totalDonations || 0, '$', locale)} {formatMessage({ diff --git a/src/components/views/project/projectActionCard/QFSection.tsx b/src/components/views/project/projectActionCard/QFSection.tsx index 5733a868d8..03665d2688 100644 --- a/src/components/views/project/projectActionCard/QFSection.tsx +++ b/src/components/views/project/projectActionCard/QFSection.tsx @@ -46,7 +46,7 @@ const QFSection: FC = ({ projectData }) => { qfRounds, estimatedMatching, sumDonationValueUsdForActiveQfRound, - sumDonationValueUsd, + totalDonations, adminUser, slug, organization, @@ -136,7 +136,7 @@ const QFSection: FC = ({ projectData }) => { })} {' ' + formatDonation( - sumDonationValueUsd || 0, + totalDonations || 0, '$', locale, )} @@ -188,7 +188,7 @@ const QFSection: FC = ({ projectData }) => { })} {' ' + formatDonation( - sumDonationValueUsd || 0, + totalDonations || 0, '$', locale, )} diff --git a/src/components/views/projects/ActiveQFRoundStats.tsx b/src/components/views/projects/ActiveQFRoundStats.tsx index 08965bad04..39ee73a219 100644 --- a/src/components/views/projects/ActiveQFRoundStats.tsx +++ b/src/components/views/projects/ActiveQFRoundStats.tsx @@ -8,31 +8,33 @@ import { B, } from '@giveth/ui-design-system'; import React from 'react'; -import styled from 'styled-components'; +import styled, { css } from 'styled-components'; import { useIntl } from 'react-intl'; import { useQuery } from '@apollo/client'; import { FETCH_QF_ROUND_STATS } from '@/apollo/gql/gqlQF'; -import { useProjectsContext } from '@/context/projects.context'; import { formatDate, formatUSD, thousandsSeparator } from '@/lib/helpers'; +import { useAppSelector } from '@/features/hooks'; +import { hasRoundStarted } from '@/helpers/qf'; export const ActiveQFRoundStats = () => { const { formatMessage } = useIntl(); - const { qfRounds } = useProjectsContext(); - const activeRound = qfRounds.find(round => round.isActive); + const { activeQFRound } = useAppSelector(state => state.general); + + const isRoundStarted = hasRoundStarted(activeQFRound); const { allocatedFundUSD, allocatedFundUSDPreferred, allocatedTokenSymbol, allocatedFund, - } = activeRound || {}; + } = activeQFRound || {}; const { data } = useQuery(FETCH_QF_ROUND_STATS, { - variables: { slug: activeRound?.slug }, + variables: { slug: activeQFRound?.slug }, }); return ( - {activeRound?.name} Metrics - + {activeQFRound?.name} Metrics + {formatMessage({ id: 'label.matching_pool' })} @@ -47,37 +49,44 @@ export const ActiveQFRoundStats = () => { {!allocatedFundUSDPreferred && allocatedTokenSymbol} - - - {formatMessage({ id: 'label.donations' })} - - - $ - {formatUSD(data?.qfRoundStats?.allDonationsUsdValue) || - ' --'} - - - - - {formatMessage({ id: 'label.number_of_unique_donors' })} - - - {data?.qfRoundStats?.uniqueDonors || '--'} - - + {isRoundStarted && ( + + + {formatMessage({ id: 'label.donations' })} + + + $ + {formatUSD( + data?.qfRoundStats?.allDonationsUsdValue, + ) || ' --'} + + + )} + {isRoundStarted && ( + + + {formatMessage({ + id: 'label.number_of_unique_donors', + })} + + + {data?.qfRoundStats?.uniqueDonors || '--'} + + + )} Round start - {activeRound?.endDate - ? formatDate(new Date(activeRound.beginDate)) + {activeQFRound?.endDate + ? formatDate(new Date(activeQFRound.beginDate)) : '--'} Round end - {activeRound?.endDate - ? formatDate(new Date(activeRound.endDate)) + {activeQFRound?.endDate + ? formatDate(new Date(activeQFRound.endDate)) : '--'} @@ -99,7 +108,7 @@ const Title = styled(H5)` margin-bottom: 40px; `; -const InfoSection = styled(Flex)` +const InfoSection = styled(Flex)<{ $started: boolean }>` flex-direction: column; margin-top: 40px; padding: 24px; @@ -110,6 +119,13 @@ const InfoSection = styled(Flex)` ${mediaQueries.tablet} { flex-direction: row; } + ${props => + !props.$started && + css` + justify-content: flex-start; + gap: 64px; + width: fit-content; + `} `; const ItemContainer = styled.div``; diff --git a/src/components/views/projects/MiddleBanners/QFMiddleBanner.tsx b/src/components/views/projects/MiddleBanners/QFMiddleBanner.tsx index dc4af5cf08..78fcb33f4e 100644 --- a/src/components/views/projects/MiddleBanners/QFMiddleBanner.tsx +++ b/src/components/views/projects/MiddleBanners/QFMiddleBanner.tsx @@ -1,18 +1,14 @@ import { semanticColors } from '@giveth/ui-design-system'; import { useIntl } from 'react-intl'; -import { useRouter } from 'next/router'; import { Box, BigArc, Title, Caption } from './common.sc'; +import { useAppSelector } from '@/features/hooks'; import { useProjectsContext } from '@/context/projects.context'; export const QFProjectsMiddleBanner = () => { - const router = useRouter(); const { formatMessage } = useIntl(); - - const { qfRounds, isArchivedQF } = useProjectsContext(); - const round = qfRounds.find(round => { - if (isArchivedQF) return round.slug === router.query.slug; - else return round.isActive; - }); + const { activeQFRound } = useAppSelector(state => state.general); + const { archivedQFRound } = useProjectsContext(); + const round = archivedQFRound || activeQFRound; return ( diff --git a/src/components/views/projects/MiddleBanners/QFNoResultBanner.tsx b/src/components/views/projects/MiddleBanners/QFNoResultBanner.tsx index 25f87adfda..e5f4771772 100644 --- a/src/components/views/projects/MiddleBanners/QFNoResultBanner.tsx +++ b/src/components/views/projects/MiddleBanners/QFNoResultBanner.tsx @@ -1,9 +1,18 @@ -import { ButtonLink, semanticColors } from '@giveth/ui-design-system'; +import { + ButtonLink, + Flex, + Lead, + OutlineLinkButton, + mediaQueries, + neutralColors, + semanticColors, +} from '@giveth/ui-design-system'; import { useIntl } from 'react-intl'; import styled from 'styled-components'; import Link from 'next/link'; import { Box, BigArc, Title, Caption } from './common.sc'; import links from '@/lib/constants/links'; +import Routes from '@/lib/constants/Routes'; export const QFNoResultBanner = () => { const { formatMessage } = useIntl(); @@ -20,15 +29,27 @@ export const QFNoResultBanner = () => { id: 'label.support_upcoming_qf_round', })} - - - + + + + + or + + + + ); }; @@ -38,6 +59,19 @@ const StyledBox = styled(Box)` margin-bottom: 96px; `; +const Actions = styled(Flex)` + gap: 24px; + flex-direction: column; + align-items: center; + ${mediaQueries.laptopS} { + flex-direction: row; + } +`; + const DonateButton = styled(ButtonLink)` - max-width: 300px; + min-width: 300px; +`; + +const ExploreButton = styled(OutlineLinkButton)` + min-width: 300px; `; diff --git a/src/components/views/projects/ProjectsIndex.tsx b/src/components/views/projects/ProjectsIndex.tsx index 9c5b9d9f5a..025a50b22f 100644 --- a/src/components/views/projects/ProjectsIndex.tsx +++ b/src/components/views/projects/ProjectsIndex.tsx @@ -38,6 +38,8 @@ import { ArchivedQFRoundStats } from './ArchivedQFRoundStats'; import { ArchivedQFProjectsBanner } from './qfBanner/ArchivedQFProjectsBanner'; import { ActiveQFRoundStats } from './ActiveQFRoundStats'; import useMediaQuery from '@/hooks/useMediaQuery'; +import { QFHeader } from '@/components/views/archivedQFRounds/QFHeader'; +import { DefaultQFBanner } from '@/components/DefaultQFBanner'; export interface IProjectsView { projects: IProject[]; @@ -54,6 +56,7 @@ const ProjectsIndex = (props: IProjectsView) => { const { formatMessage } = useIntl(); const { projects, totalCount: _totalCount } = props; const user = useAppSelector(state => state.user.userData); + const { activeQFRound } = useAppSelector(state => state.general); const [isLoading, setIsLoading] = useState(false); const [filteredProjects, setFilteredProjects] = useState(projects); @@ -68,7 +71,6 @@ const ProjectsIndex = (props: IProjectsView) => { selectedMainCategory, isQF, isArchivedQF, - qfRounds, } = useProjectsContext(); const router = useRouter(); @@ -172,7 +174,7 @@ const ProjectsIndex = (props: IProjectsView) => { const showLoadMore = totalCount > filteredProjects?.length && !isInfiniteScrolling.current; - const activeRound = qfRounds.find(round => round.isActive); + const onProjectsPageOrActiveQFPage = !isQF || (isQF && activeQFRound); useEffect(() => { const handleObserver = (entities: any) => { @@ -210,25 +212,30 @@ const ProjectsIndex = (props: IProjectsView) => { {isArchivedQF ? ( !isMobile && - ) : ( + ) : activeQFRound ? ( + ) : ( + )} ) : ( )} + {isQF && } {isArchivedQF ? ( ) : ( <> - {isQF && } - + {isQF && activeQFRound && } + {onProjectsPageOrActiveQFPage && } )} - - - + {onProjectsPageOrActiveQFPage && ( + + + + )} {isLoading && } {filteredProjects?.length > 0 ? ( @@ -248,7 +255,7 @@ const ProjectsIndex = (props: IProjectsView) => { {/* */} - ) : isQF && !activeRound ? ( + ) : isQF && !activeQFRound ? ( ) : ( diff --git a/src/components/views/projects/qfBanner/ActiveQFProjectsBanner.tsx b/src/components/views/projects/qfBanner/ActiveQFProjectsBanner.tsx index 8108df164e..a684ae5482 100644 --- a/src/components/views/projects/qfBanner/ActiveQFProjectsBanner.tsx +++ b/src/components/views/projects/qfBanner/ActiveQFProjectsBanner.tsx @@ -2,7 +2,6 @@ import { B, Lead, Container, Row, H2, Flex } from '@giveth/ui-design-system'; import { useIntl } from 'react-intl'; import Image from 'next/image'; import { useState, useEffect } from 'react'; -import { useProjectsContext } from '@/context/projects.context'; import { getNowUnixMS } from '@/helpers/time'; import { durationToString } from '@/lib/helpers'; import { @@ -13,6 +12,7 @@ import { Sponsor, SmallerSponsor, } from './common'; +import { useAppSelector } from '@/features/hooks'; enum ERoundStatus { LOADING, @@ -26,13 +26,12 @@ export const ActiveQFProjectsBanner = () => { const [state, setState] = useState(ERoundStatus.LOADING); const [timer, setTimer] = useState(null); const { formatMessage } = useIntl(); - const { qfRounds } = useProjectsContext(); - const activeRound = qfRounds.find(round => round.isActive); + const { activeQFRound } = useAppSelector(state => state.general); useEffect(() => { - if (!activeRound) return setState(ERoundStatus.NO_ACTIVE); - const _startDate = new Date(activeRound?.beginDate).getTime(); - const _endDate = new Date(activeRound?.endDate).getTime(); + if (!activeQFRound) return setState(ERoundStatus.NO_ACTIVE); + const _startDate = new Date(activeQFRound?.beginDate).getTime(); + const _endDate = new Date(activeQFRound?.endDate).getTime(); const now = getNowUnixMS(); const isRoundStarted = now > _startDate; const isRoundEnded = now > _endDate; @@ -43,15 +42,15 @@ export const ActiveQFProjectsBanner = () => { } else { setState(ERoundStatus.ENDED); } - }, [activeRound]); + }, [activeQFRound]); useEffect(() => { let _date: number; - if (!activeRound) return; + if (!activeQFRound) return; if (state === ERoundStatus.NOT_STARTED) { - _date = new Date(activeRound.beginDate).getTime(); + _date = new Date(activeQFRound.beginDate).getTime(); } else if (state === ERoundStatus.RUNNING) { - _date = new Date(activeRound.endDate).getTime(); + _date = new Date(activeQFRound.endDate).getTime(); } else { return; } @@ -70,13 +69,13 @@ export const ActiveQFProjectsBanner = () => { return () => { clearInterval(interval); }; - }, [state, activeRound]); + }, [state, activeQFRound]); return ( { - {activeRound ? activeRound.name : null} + {activeQFRound ? activeQFRound.name : null}

{formatMessage({ id: 'label.quadratic_funding' })} @@ -104,7 +103,7 @@ export const ActiveQFProjectsBanner = () => { })} - {activeRound && timer && timer > 0 + {activeQFRound && timer && timer > 0 ? durationToString(timer, 3) : '--'} diff --git a/src/components/views/projects/qfBanner/ArchivedQFProjectsBanner.tsx b/src/components/views/projects/qfBanner/ArchivedQFProjectsBanner.tsx index e9bee74e62..46cfb875c4 100644 --- a/src/components/views/projects/qfBanner/ArchivedQFProjectsBanner.tsx +++ b/src/components/views/projects/qfBanner/ArchivedQFProjectsBanner.tsx @@ -1,7 +1,6 @@ import { Container, H2, Row, H1 } from '@giveth/ui-design-system'; import Image from 'next/image'; import { useIntl } from 'react-intl'; -import { useRouter } from 'next/router'; import styled from 'styled-components'; import { BannerContainer, StyledColArch } from './common'; import { useProjectsContext } from '@/context/projects.context'; @@ -14,9 +13,7 @@ type TImgDimensionsMap = { export const ArchivedQFProjectsBanner = () => { const { formatMessage } = useIntl(); - const { query } = useRouter(); - const { qfRounds } = useProjectsContext(); - const round = qfRounds.find(round => round.slug === query.slug); + const { archivedQFRound: round } = useProjectsContext(); const sponsorsLength = round?.sponsorsImgs?.length ?? 0; const imgDimensionsMap: TImgDimensionsMap = { 1: { desktop: 300, tablet: 260, gridColumns: 1 }, diff --git a/src/components/views/userProfile/UserProfile.view.tsx b/src/components/views/userProfile/UserProfile.view.tsx index 39a3758322..f9de621c8f 100644 --- a/src/components/views/userProfile/UserProfile.view.tsx +++ b/src/components/views/userProfile/UserProfile.view.tsx @@ -125,7 +125,6 @@ const UserProfileView: FC = () => {
{formatMessage({ id: 'label.please_sign_in' })}
); - return ( <> @@ -194,22 +193,28 @@ const UserProfileView: FC = () => { ) : ( - - - - View this Givers PFP on Rarible{' '} - - - - + pfpToken && ( + + + + View this Givers PFP on + Rarible{' '} + + + + + ) ))} diff --git a/src/components/views/userProfile/donationsTab/ProfileDonationsTab.tsx b/src/components/views/userProfile/donationsTab/ProfileDonationsTab.tsx index 49cd54d653..56fb7da5ef 100644 --- a/src/components/views/userProfile/donationsTab/ProfileDonationsTab.tsx +++ b/src/components/views/userProfile/donationsTab/ProfileDonationsTab.tsx @@ -11,6 +11,7 @@ import { useProfileContext } from '@/context/profile.context'; import { OneTimeTab } from './oneTimeTab/OneTimeTab'; import { RecurringTab } from './recurringTab/RecurringTab'; import { ProfileDonateTabProvider } from './recurringTab/ProfileDonateTab.context'; +import { getUserName } from '@/helpers/user'; enum ETab { ONE_TIME, @@ -40,7 +41,7 @@ const ProfileDonationsTab: FC = () => { const { myAccount, user } = useProfileContext(); const { formatMessage } = useIntl(); - const userName = user?.name || 'Unknown'; + const userName = getUserName(user); return ( diff --git a/src/components/views/userProfile/donationsTab/recurringTab/RecurringDonationsTable.tsx b/src/components/views/userProfile/donationsTab/recurringTab/RecurringDonationsTable.tsx index 22a03d2f03..ada4c3a5ed 100644 --- a/src/components/views/userProfile/donationsTab/recurringTab/RecurringDonationsTable.tsx +++ b/src/components/views/userProfile/donationsTab/recurringTab/RecurringDonationsTable.tsx @@ -7,6 +7,7 @@ import { IconLink24, neutralColors, P, + semanticColors, } from '@giveth/ui-design-system'; import { useIntl } from 'react-intl'; import { formatUnits } from 'viem'; @@ -25,7 +26,7 @@ import { import { ONE_MONTH_SECONDS } from '@/lib/constants/constants'; import NetworkLogo from '@/components/NetworkLogo'; import SortIcon from '@/components/SortIcon'; -import { limitFraction } from '@/helpers/number'; +import { formatDonation, limitFraction } from '@/helpers/number'; import { StreamActionButton } from './StreamActionButton'; import RecurringDonationStatusBadge from '@/components/badges/RecurringDonationStatusBadge'; @@ -75,6 +76,9 @@ const RecurringDonationTable: FC = ({ {formatMessage({ id: 'label.total_donated' })} + + {formatMessage({ id: 'label.usd_value' })} + {myAccount && ( <> @@ -117,7 +121,7 @@ const RecurringDonationTable: FC = ({ ) : ( - + {limitFraction( formatUnits( BigInt(donation.flowRate) * @@ -130,9 +134,15 @@ const RecurringDonationTable: FC = ({ )} - {limitFraction(donation.amountStreamed, 10, true) || 0} + + {limitFraction(donation.amountStreamed, 10, true) || + 0} + {donation.currency} + + {formatDonation(donation.totalUsdStreamed, '$') || 0} + {myAccount && ( <> @@ -183,8 +193,8 @@ const DonationTableContainer = styled.div<{ $myAccount?: boolean }>` display: grid; grid-template-columns: ${props => props.$myAccount - ? '1.5fr 2fr 1fr 1.7fr 1.2fr 1fr 1fr' - : '1fr 2fr .5fr 1fr 1fr'}; + ? '1.2fr 2fr 0.6fr 1.3fr 1.5fr 1fr 0.5fr 0.6fr' + : '1fr 2fr .5fr 1fr 1fr 1fr'}; overflow: auto; min-width: 900px; margin: 0 10px; diff --git a/src/components/views/userProfile/projectsTab/ProfileProjectsTab.tsx b/src/components/views/userProfile/projectsTab/ProfileProjectsTab.tsx index b8bace06fc..b10fc539c3 100644 --- a/src/components/views/userProfile/projectsTab/ProfileProjectsTab.tsx +++ b/src/components/views/userProfile/projectsTab/ProfileProjectsTab.tsx @@ -16,6 +16,7 @@ import { UserContributeTitle, UserProfileTab } from '../common.sc'; import { ProjectsContributeCard } from '@/components/ContributeCard'; import { useProfileContext } from '@/context/profile.context'; import ProjectItem from './ProjectItem'; +import { getUserName } from '@/helpers/user'; const itemPerPage = 10; @@ -30,7 +31,7 @@ const ProfileProjectsTab: FC = () => { }); const { user, myAccount } = useProfileContext(); const { formatMessage } = useIntl(); - const userName = user?.name || 'Unknown'; + const userName = getUserName(user); const changeOrder = (orderBy: EOrderBy) => { if (orderBy === order.by) { diff --git a/src/components/views/userProfile/projectsTab/ProjectActions.tsx b/src/components/views/userProfile/projectsTab/ProjectActions.tsx index 7c0ba09e84..8432d10593 100644 --- a/src/components/views/userProfile/projectsTab/ProjectActions.tsx +++ b/src/components/views/userProfile/projectsTab/ProjectActions.tsx @@ -25,6 +25,7 @@ interface IProjectActions { setSelectedProject: Dispatch>; setShowAddressModal: Dispatch>; setShowClaimModal?: Dispatch>; + className?: string; } const ProjectActions = (props: IProjectActions) => { @@ -33,6 +34,7 @@ const ProjectActions = (props: IProjectActions) => { setSelectedProject, setShowAddressModal, setShowClaimModal, + className, } = props; const status = project.status.name; const isCancelled = status === EProjectStatus.CANCEL; @@ -109,6 +111,7 @@ const ProjectActions = (props: IProjectActions) => { onMouseLeave={() => setIsHover(false)} $isOpen={isHover} $isCancelled={isCancelled} + className={className} > {isCancelled ? ( CANCELLED diff --git a/src/components/views/userProfile/projectsTab/ProjectItem.tsx b/src/components/views/userProfile/projectsTab/ProjectItem.tsx index 8d979c835c..94ac107367 100644 --- a/src/components/views/userProfile/projectsTab/ProjectItem.tsx +++ b/src/components/views/userProfile/projectsTab/ProjectItem.tsx @@ -7,6 +7,7 @@ import { Subline, neutralColors, Flex, + mediaQueries, } from '@giveth/ui-design-system'; import React, { Dispatch, SetStateAction, useState } from 'react'; import styled from 'styled-components'; @@ -36,7 +37,11 @@ const ProjectItem = ({ project, setProjects }: IProjectItem) => { return ( - +
@@ -53,15 +58,15 @@ const ProjectItem = ({ project, setProjects }: IProjectItem) => {

{project.title}

- -
+ - +

{formatMessage({ id: 'label.project_status' })}

@@ -119,13 +124,13 @@ const ProjectItem = ({ project, setProjects }: IProjectItem) => {

{formatDonation( - project.sumDonationValueUsd || 0, + project.totalDonations || 0, '$', locale, )}
- + {showAddressModal && selectedProject && ( { return ( <> -

+

{titles[status ?? EVerificationStatus.SUBMITTED]}

{subtitles[status ?? EVerificationStatus.SUBMITTED]}

diff --git a/src/config/development.tsx b/src/config/development.tsx index dd588d7643..76bfab5a37 100644 --- a/src/config/development.tsx +++ b/src/config/development.tsx @@ -6,6 +6,7 @@ import { optimismSepolia, polygon, arbitrumSepolia, + baseSepolia, } from 'wagmi/chains'; import { WalletAdapterNetwork } from '@solana/wallet-adapter-base'; import { type Chain } from 'viem'; @@ -23,6 +24,7 @@ import { IconOptimism } from '@/components/Icons/Optimism'; import { IconGnosisChain } from '@/components/Icons/GnosisChain'; import { IconEthereum } from '@/components/Icons/Eth'; import { IconUnknown } from '@/components/Icons/Unknown'; +import IconBase from '@/components/Icons/Base'; import IconSolana from '@/components/Icons/Solana'; import IconArbitrum from '@/components/Icons/Arbitrum'; @@ -51,6 +53,7 @@ const OPTIMISM_NETWORK_NUMBER = 11155420; const CELO_NETWORK_NUMBER = 44787; const CLASSIC_NETWORK_NUMBER = 63; const ARBITRUM_NETWORK_NUMBER = 421614; +const BASE_NETWORK_NUMBER = 84532; const SOLANA_NETWORK: NonEVMChain = { id: 0, @@ -86,7 +89,9 @@ const classic = { url: 'https://etc-mordor.blockscout.com', }, }, - subgraphAddress: 'http://167.172.97.150:8000/subgraphs/name/giveth/etc', + subgraphAddress: + process.env.NEXT_PUBLIC_SUBGRAPH_CLASSIC || + 'http://167.172.97.150:8000/subgraphs/name/giveth/etc', }; const EVM_CHAINS = [ @@ -96,6 +101,7 @@ const EVM_CHAINS = [ optimismSepolia, celoAlfajores, arbitrumSepolia, + baseSepolia, classic, ] as readonly [Chain, ...Chain[]]; @@ -120,6 +126,7 @@ const config: EnvConfig = { CELO_NETWORK_NUMBER: CELO_NETWORK_NUMBER, ARBITRUM_NETWORK_NUMBER: ARBITRUM_NETWORK_NUMBER, CLASSIC_NETWORK_NUMBER: CLASSIC_NETWORK_NUMBER, + BASE_NETWORK_NUMBER: BASE_NETWORK_NUMBER, RARIBLE_ADDRESS: 'https://testnet.rarible.com/', MAINNET_CONFIG: { @@ -133,6 +140,7 @@ const config: EnvConfig = { // Keep it empty for automatic configuration }, subgraphAddress: + process.env.NEXT_PUBLIC_SUBGRAPH_MAINNET || 'https://api.studio.thegraph.com/query/40764/giveconomy-staging-goerli/1.5.0?source=giveth', coingeckoChainName: 'ethereum', chainLogo: (logoSize?: number) => , @@ -189,6 +197,7 @@ const config: EnvConfig = { }, subgraphAddress: + process.env.NEXT_PUBLIC_SUBGRAPH_GNOSIS || 'https://api.studio.thegraph.com/query/40764/giveconomy-staging-gnosischain/1.5.1?source=giveth', coingeckoChainName: 'xdai', chainLogo: (logoSize?: number) => , @@ -351,6 +360,7 @@ const config: EnvConfig = { }, anchorRegistryAddress: '0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3', subgraphAddress: + process.env.NEXT_PUBLIC_SUBGRAPH_OPTIMISM || 'https://api.thegraph.com/subgraphs/name/giveth/giveth-economy-optim-sepolia?source=giveth', GIV_TOKEN_ADDRESS: OPTIMISM_GIV_TOKEN_ADDRESS, GIV_BUY_LINK: @@ -428,6 +438,16 @@ const config: EnvConfig = { chainLogo: (logoSize?: number) => , }, + BASE_CONFIG: { + ...baseSepolia, + chainType: ChainType.EVM, + coingeckoChainName: 'base', + gasPreference: { + // Keep it empty for automatic configuration + }, + chainLogo: (logoSize?: number) => , + }, + CLASSIC_CONFIG: { ...classic, //TODO: should change the icon diff --git a/src/config/production.tsx b/src/config/production.tsx index e9d0b352ca..8daab5132f 100644 --- a/src/config/production.tsx +++ b/src/config/production.tsx @@ -6,6 +6,7 @@ import { optimism, polygon, arbitrum, + base, } from '@wagmi/core/chains'; import { WalletAdapterNetwork } from '@solana/wallet-adapter-base'; import React from 'react'; @@ -24,6 +25,7 @@ import { IconPolygon } from '@/components/Icons/Polygon'; import { IconOptimism } from '@/components/Icons/Optimism'; import { IconCelo } from '@/components/Icons/Celo'; import { IconClassic } from '@/components/Icons/Classic'; +import IconBase from '@/components/Icons/Base'; import IconSolana from '@/components/Icons/Solana'; import IconArbitrum from '@/components/Icons/Arbitrum'; @@ -37,6 +39,7 @@ const POLYGON_NETWORK_NUMBER = 137; const OPTIMISM_NETWORK_NUMBER = 10; const CELO_NETWORK_NUMBER = 42220; const ARBITRUM_NETWORK_NUMBER = 42161; +const BASE_NETWORK_NUMBER = 8453; const CLASSIC_NETWORK_NUMBER = 61; const SOLANA_NETWORK: NonEVMChain = { id: 0, @@ -60,6 +63,7 @@ const EVM_CHAINS = [ celo, arbitrum, classic, + base, ] as readonly [Chain, ...Chain[]]; const NON_EVM_CHAINS: NonEVMChain[] = [SOLANA_NETWORK]; @@ -93,6 +97,7 @@ const config: EnvConfig = { OPTIMISM_NETWORK_NUMBER: OPTIMISM_NETWORK_NUMBER, CELO_NETWORK_NUMBER: CELO_NETWORK_NUMBER, ARBITRUM_NETWORK_NUMBER: ARBITRUM_NETWORK_NUMBER, + BASE_NETWORK_NUMBER: BASE_NETWORK_NUMBER, CLASSIC_NETWORK_NUMBER: CLASSIC_NETWORK_NUMBER, RARIBLE_ADDRESS: 'https://rarible.com/', @@ -107,6 +112,7 @@ const config: EnvConfig = { }, subgraphAddress: + process.env.NEXT_PUBLIC_SUBGRAPH_MAINNET || 'https://api.thegraph.com/subgraphs/name/giveth/giveth-economy-second-mainnet?source=giveth', coingeckoChainName: 'ethereum', chainLogo: (logoSize = 24) => , @@ -251,6 +257,7 @@ const config: EnvConfig = { }, subgraphAddress: + process.env.NEXT_PUBLIC_SUBGRAPH_GNOSIS || 'https://api.thegraph.com/subgraphs/name/giveth/giveth-economy-second-xdai?source=giveth', coingeckoChainName: 'xdai', chainLogo: (logoSize = 24) => , @@ -398,6 +405,7 @@ const config: EnvConfig = { }, anchorRegistryAddress: '0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3', subgraphAddress: + process.env.NEXT_PUBLIC_SUBGRAPH_OPTIMISM || 'https://api.thegraph.com/subgraphs/name/giveth/giveconomy-optimism-mainnet?source=giveth', GIV_TOKEN_ADDRESS: OPTIMISM_GIV_TOKEN_ADDRESS, GIV_BUY_LINK: @@ -520,13 +528,25 @@ const config: EnvConfig = { coingeckoChainName: 'arbitrum', chainLogo: (logoSize = 24) => , }, + BASE_CONFIG: { + ...base, + chainType: ChainType.EVM, + gasPreference: { + // Keep it empty for automatic configuration + }, + subgraphAddress: '', + coingeckoChainName: 'base', + chainLogo: (logoSize = 24) => , + }, CLASSIC_CONFIG: { ...classic, chainType: ChainType.EVM, gasPreference: { // Keep it empty for automatic configuration }, - subgraphAddress: 'http://167.172.97.150:8000/subgraphs/name/giveth/etc', + subgraphAddress: + process.env.NEXT_PUBLIC_SUBGRAPH_CLASSIC || + 'http://167.172.97.150:8000/subgraphs/name/giveth/etc', coingeckoChainName: 'ethereum-classic', chainLogo: (logoSize = 24) => , }, diff --git a/src/configuration.ts b/src/configuration.ts index 3afa1029c4..64c2db92b1 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -17,6 +17,7 @@ const EVM_NETWORKS_CONFIG = { [envConfig.OPTIMISM_NETWORK_NUMBER]: envConfig.OPTIMISM_CONFIG, [envConfig.CELO_NETWORK_NUMBER]: envConfig.CELO_CONFIG, [envConfig.ARBITRUM_NETWORK_NUMBER]: envConfig.ARBITRUM_CONFIG, + [envConfig.BASE_NETWORK_NUMBER]: envConfig.BASE_CONFIG, [envConfig.CLASSIC_NETWORK_NUMBER]: envConfig.CLASSIC_CONFIG, }; diff --git a/src/context/donate.context.tsx b/src/context/donate.context.tsx index e4ce5886e2..a1dfa59b14 100644 --- a/src/context/donate.context.tsx +++ b/src/context/donate.context.tsx @@ -8,7 +8,7 @@ import { type Dispatch, } from 'react'; import { useCallback } from 'react'; -import { IDonationProject } from '@/apollo/types/types'; +import { IProject } from '@/apollo/types/types'; import { hasActiveRound } from '@/helpers/qf'; import { ISuperfluidStream, IToken } from '@/types/superFluid'; import { ChainType } from '@/types/config'; @@ -29,7 +29,7 @@ interface ISuccessDonation { interface IDonateContext { hasActiveQFRound?: boolean; - project: IDonationProject; + project: IProject; successDonation?: ISuccessDonation; tokenStreams: ITokenStreams; setSuccessDonation: (successDonation?: ISuccessDonation) => void; @@ -42,13 +42,13 @@ interface IDonateContext { interface IProviderProps { children: ReactNode; - project: IDonationProject; + project: IProject; } const DonateContext = createContext({ setSuccessDonation: () => {}, setSelectedToken: () => {}, - project: {} as IDonationProject, + project: {} as IProject, tokenStreams: {}, fetchProject: async () => {}, }); @@ -71,14 +71,14 @@ export const DonateProvider: FC = ({ children, project }) => { ISelectTokenWithBalance | undefined >(); const [successDonation, setSuccessDonation] = useState(); - const [projectData, setProjectData] = useState(project); + const [projectData, setProjectData] = useState(project); const fetchProject = useCallback(async () => { const { data } = (await client.query({ query: FETCH_PROJECT_BY_SLUG_DONATION, variables: { slug: project.slug }, fetchPolicy: 'no-cache', - })) as { data: { projectBySlug: IDonationProject } }; + })) as { data: { projectBySlug: IProject } }; setProjectData(data.projectBySlug); }, [project.slug]); diff --git a/src/context/projects.context.tsx b/src/context/projects.context.tsx index 3b2df6d31d..26e8184ec7 100644 --- a/src/context/projects.context.tsx +++ b/src/context/projects.context.tsx @@ -24,7 +24,7 @@ interface IProjectsContext { variables: IVariables; mainCategories: IMainCategory[]; selectedMainCategory?: IMainCategory; - qfRounds: IQFRound[]; + archivedQFRound?: IQFRound; isQF: boolean; isArchivedQF?: boolean; setIsQF: Dispatch>; @@ -38,7 +38,6 @@ const variablesDefaultValue = { const ProjectsContext = createContext({ variables: variablesDefaultValue, mainCategories: [], - qfRounds: [], isQF: false, isArchivedQF: false, setIsQF: () => console.log('setIsQF not initialed yet!'), @@ -50,7 +49,7 @@ export const ProjectsProvider = (props: { children: ReactNode; mainCategories: IMainCategory[]; selectedMainCategory?: IMainCategory; - qfRounds: IQFRound[]; + archivedQFRound?: IQFRound; isQF: boolean; isArchivedQF?: boolean; }) => { @@ -60,7 +59,7 @@ export const ProjectsProvider = (props: { selectedMainCategory, isQF, isArchivedQF, - qfRounds, + archivedQFRound, } = props; const [_isQF, setIsQF] = useState(isQF); @@ -101,9 +100,9 @@ export const ProjectsProvider = (props: { }, mainCategories, selectedMainCategory, - qfRounds: qfRounds || [], isQF: _isQF || false, isArchivedQF: isArchivedQF || false, + archivedQFRound, setIsQF, }} > diff --git a/src/features/general/general.slice.ts b/src/features/general/general.slice.ts index 11bf0b36ac..74e3a031b2 100644 --- a/src/features/general/general.slice.ts +++ b/src/features/general/general.slice.ts @@ -1,5 +1,5 @@ import { createSlice } from '@reduxjs/toolkit'; -import { fetchMainCategories, fetchQFRounds } from './general.thunk'; +import { fetchMainCategories, fetchActiveQFRounds } from './general.thunk'; import { IMainCategory, IQFRound } from '@/apollo/types/types'; import { QF_SPECIFIC_CATEGORIES } from '@/configuration'; import type { PayloadAction } from '@reduxjs/toolkit'; @@ -51,10 +51,9 @@ export const GeneralSlice = createSlice({ !QF_SPECIFIC_CATEGORIES.some(c => c === mainCategory.slug), ); }); - builder.addCase(fetchQFRounds.fulfilled, (state, action) => { - state.qfRounds = action.payload.data.qfRounds; - state.activeQFRound = - state.qfRounds.find(round => round.isActive) || null; + builder.addCase(fetchActiveQFRounds.fulfilled, (state, action) => { + const qfRounds = action.payload; + state.activeQFRound = qfRounds ? qfRounds[0] : null; }); }, }); diff --git a/src/features/general/general.thunk.ts b/src/features/general/general.thunk.ts index d79b6f85da..b6366c79cd 100644 --- a/src/features/general/general.thunk.ts +++ b/src/features/general/general.thunk.ts @@ -1,7 +1,8 @@ import { createAsyncThunk } from '@reduxjs/toolkit'; import { backendGQLRequest } from '@/helpers/requests'; -import { FETCH_MAIN_CATEGORIES } from './general.queries'; import { FETCH_QF_ROUNDS_QUERY } from '@/apollo/gql/gqlQF'; +import { FETCH_MAIN_CATEGORIES } from './general.queries'; +import { client } from '@/apollo/apolloClient'; export const fetchMainCategories = createAsyncThunk( 'general/fetchMainCategories', @@ -10,9 +11,16 @@ export const fetchMainCategories = createAsyncThunk( }, ); -export const fetchQFRounds = createAsyncThunk( +export const fetchActiveQFRounds = createAsyncThunk( 'general/fetchQFRounds', async () => { - return backendGQLRequest(FETCH_QF_ROUNDS_QUERY); + const { + data: { qfRounds }, + } = await client.query({ + query: FETCH_QF_ROUNDS_QUERY, + variables: { activeOnly: true }, + fetchPolicy: 'no-cache', + }); + return qfRounds; }, ); diff --git a/src/helpers/html.tsx b/src/helpers/html.tsx index cba40b4f6c..82fd1359bf 100644 --- a/src/helpers/html.tsx +++ b/src/helpers/html.tsx @@ -22,7 +22,7 @@ import { IconUnstake24, IconVerifiedBadge24, IconNotificationOutline24, - IconGIVBack, + IconGIVBack24, } from '@giveth/ui-design-system'; import styled from 'styled-components'; import { INotification } from '@/features/notification/notification.types'; @@ -150,7 +150,7 @@ export function convertBackendIconsToComponents(icon: string) { case 'IconUnstake': return ; case 'IconGIVBack': - return ; + return ; case 'IconStake': return ; case 'IconDonation': diff --git a/src/helpers/qf.ts b/src/helpers/qf.ts index 88dea89b58..04a651f953 100644 --- a/src/helpers/qf.ts +++ b/src/helpers/qf.ts @@ -22,6 +22,10 @@ export const getActiveRound = (qfRounds: IQFRound[] | undefined) => { return { activeQFRound, activeStartedRound }; }; +export const hasRoundStarted = (qfRound: IQFRound | null): boolean => { + return !!qfRound && new Date(qfRound.beginDate).getTime() < getNowUnixMS(); +}; + export const calculateTotalEstimatedMatching = ( projectDonationsSqrtRootSum?: number, allProjectsSum?: number, diff --git a/src/helpers/url.tsx b/src/helpers/url.tsx index 40d8f8dbbd..eb13a58626 100644 --- a/src/helpers/url.tsx +++ b/src/helpers/url.tsx @@ -66,6 +66,12 @@ export function campaignLinkGenerator(campaign: ICampaign) { EProjectsFilter.ACCEPT_FUND_ON_ARBITRUM, ); break; + case ECampaignFilterField.AcceptFundOnBase: + params.append( + 'filter', + EProjectsFilter.ACCEPT_FUND_ON_BASE, + ); + break; case ECampaignFilterField.AcceptFundOnOptimism: params.append( 'filter', diff --git a/src/helpers/user.ts b/src/helpers/user.ts index a241dfcd95..221e712be3 100644 --- a/src/helpers/user.ts +++ b/src/helpers/user.ts @@ -1,6 +1,16 @@ import StorageLabel from '@/lib/localStorage'; import { getLocalStorageData } from './localstorage'; +import { IUser } from '@/apollo/types/types'; export function getTokens() { return getLocalStorageData(StorageLabel.TOKENS); } + +export function getUserName(user?: IUser, short = false) { + if (!user) return 'Unknown'; + return user.name || + `${user.firstName || ''} ${user.lastName || ''}`.trim() || + short + ? user.walletAddress?.substring(0, 8) + '...' + : user.walletAddress; +} diff --git a/src/hooks/usePassport.ts b/src/hooks/usePassport.ts index 5d20931bb7..46df0a5515 100644 --- a/src/hooks/usePassport.ts +++ b/src/hooks/usePassport.ts @@ -2,8 +2,6 @@ import { useCallback, useEffect, useState } from 'react'; import { useAccount } from 'wagmi'; import { getPassports } from '@/helpers/passport'; import { connectPassport, fetchPassportScore } from '@/services/passport'; -import { FETCH_QF_ROUNDS } from '@/apollo/gql/gqlQF'; -import { client } from '@/apollo/apolloClient'; import { IPassportInfo, IQFRound } from '@/apollo/types/types'; import { getNowUnixMS } from '@/helpers/time'; import { useIsSafeEnvironment } from '@/hooks/useSafeAutoConnect'; @@ -45,6 +43,7 @@ export const usePassport = () => { const { userData: user, isUserFullFilled } = useAppSelector( state => state.user, ); + const { activeQFRound } = useAppSelector(state => state.general); const isSafeEnv = useIsSafeEnvironment(); const updateState = useCallback( @@ -69,68 +68,58 @@ export const usePassport = () => { currentRound: null, }); try { - const { - data: { qfRounds }, - } = await client.query({ - query: FETCH_QF_ROUNDS, - fetchPolicy: 'network-only', - }); - // setScore(refreshUserScores); - if (!qfRounds && !refreshUserScores) { + if (!refreshUserScores) { return setInfo({ passportState: EPassportState.INVALID, passportScore: null, currentRound: null, }); } - const currentRound = (qfRounds as IQFRound[]).find( - round => round.isActive, - ); - if (!currentRound) { + if (!activeQFRound) { return setInfo({ passportState: EPassportState.NOT_ACTIVE_ROUND, passportScore: refreshUserScores.passportScore, currentRound: null, }); } else if ( - getNowUnixMS() < new Date(currentRound.beginDate).getTime() + getNowUnixMS() < new Date(activeQFRound.beginDate).getTime() ) { return setInfo({ passportState: EPassportState.NOT_STARTED, passportScore: refreshUserScores.passportScore, - currentRound: currentRound, + currentRound: activeQFRound, }); } else if ( - getNowUnixMS() > new Date(currentRound.endDate).getTime() + getNowUnixMS() > new Date(activeQFRound.endDate).getTime() ) { return setInfo({ passportState: EPassportState.ENDED, passportScore: refreshUserScores.passportScore, - currentRound: currentRound, + currentRound: activeQFRound, }); } if (refreshUserScores.passportScore === null) { return setInfo({ passportState: EPassportState.NOT_CREATED, passportScore: null, - currentRound: currentRound, + currentRound: activeQFRound, }); } if ( refreshUserScores.passportScore < - currentRound.minimumPassportScore + activeQFRound.minimumPassportScore ) { return setInfo({ passportState: EPassportState.NOT_ELIGIBLE, passportScore: refreshUserScores.passportScore, - currentRound: currentRound, + currentRound: activeQFRound, }); } else { return setInfo({ passportState: EPassportState.ELIGIBLE, passportScore: refreshUserScores.passportScore, - currentRound: currentRound, + currentRound: activeQFRound, }); } } catch (error) { @@ -141,7 +130,7 @@ export const usePassport = () => { }); } }, - [], + [activeQFRound], ); const refreshScore = useCallback(async () => { diff --git a/src/types/config.ts b/src/types/config.ts index e4662982ae..1bb20552a2 100644 --- a/src/types/config.ts +++ b/src/types/config.ts @@ -209,6 +209,7 @@ export interface EnvConfig { OPTIMISM_NETWORK_NUMBER: number; CELO_NETWORK_NUMBER: number; ARBITRUM_NETWORK_NUMBER: number; + BASE_NETWORK_NUMBER: number; CLASSIC_NETWORK_NUMBER: number; MAINNET_CONFIG: MainnetNetworkConfig; GNOSIS_CONFIG: GnosisNetworkConfig; @@ -216,6 +217,7 @@ export interface EnvConfig { OPTIMISM_CONFIG: OptimismNetworkConfig; CELO_CONFIG: NetworkConfig; ARBITRUM_CONFIG: NetworkConfig; + BASE_CONFIG: NetworkConfig; CLASSIC_CONFIG: NetworkConfig; BACKEND_LINK: string; FRONTEND_LINK: string; diff --git a/yarn.lock b/yarn.lock index 9f38db1f51..fc9291b7cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1351,10 +1351,10 @@ "@solana/wallet-adapter-base" "^0.9.17" bs58 "^5.0.0" -"@giveth/ui-design-system@^1.11.27": - version "1.11.27" - resolved "https://registry.yarnpkg.com/@giveth/ui-design-system/-/ui-design-system-1.11.27.tgz#e2445acb5323d59489cb7796d693f4e8fe899189" - integrity sha512-Ob1gYjAkaN0EdKBxv8guwiIlpHEEIMWaDN1FZgUTda8VHzTJLGRksbOLWdvv9od5CN6o/vxDx2gDW8FAoUCENA== +"@giveth/ui-design-system@^1.11.28": + version "1.11.28" + resolved "https://registry.yarnpkg.com/@giveth/ui-design-system/-/ui-design-system-1.11.28.tgz#3063105cab954ed545bfff4ac1fef526710c947e" + integrity sha512-YYqIJ3w1CpXoJgsYNQNwCnTVBT0EUgHQjOCQBvI3UecpT2f4P3AZuUD53Kn1vDS5jg1PPLwN1N2zy6TCdtG31Q== dependencies: next "14.1.0" react "^18"