diff --git a/frontend/components/SocialMediaShareIcon.vue b/frontend/components/SocialMediaShareIcon.vue new file mode 100644 index 000000000..4564e1ea8 --- /dev/null +++ b/frontend/components/SocialMediaShareIcon.vue @@ -0,0 +1,43 @@ + + + diff --git a/frontend/components/modal/ModalSharePage.vue b/frontend/components/modal/ModalSharePage.vue new file mode 100644 index 000000000..7adbc4f30 --- /dev/null +++ b/frontend/components/modal/ModalSharePage.vue @@ -0,0 +1,362 @@ + + + diff --git a/frontend/i18n/check_repeat_i18n_values.py b/frontend/i18n/check_repeat_i18n_values.py index 810db69e8..b07bc298a 100644 --- a/frontend/i18n/check_repeat_i18n_values.py +++ b/frontend/i18n/check_repeat_i18n_values.py @@ -6,22 +6,23 @@ """ -from collections import Counter import json -from pathlib import Path import string +from collections import Counter +from pathlib import Path this_directory = str(Path(__file__).parent.resolve()) with open(f"{this_directory}/en-US.json") as f: en_us_json_dict = json.loads(f.read()) + def lower_and_remove_punctuation(value): return value.lower().translate(str.maketrans("", "", string.punctuation)) + all_json_values = [ - lower_and_remove_punctuation(value=v) - for v in list(en_us_json_dict.values()) + lower_and_remove_punctuation(value=v) for v in list(en_us_json_dict.values()) ] json_repeat_value_counts = { @@ -33,7 +34,8 @@ def lower_and_remove_punctuation(value): i18n_keys = [ k for k, v in en_us_json_dict.items() - if repeat_value == lower_and_remove_punctuation(value=v) and k[-len("_lower"):] != "_lower" + if repeat_value == lower_and_remove_punctuation(value=v) + and k[-len("_lower") :] != "_lower" ] # Needed as we're removing keys that are set to lowercase above. @@ -55,7 +57,7 @@ def lower_and_remove_punctuation(value): common_character = False - if common_prefix := '.'.join(common_prefix.split('.')[:-1]): + if common_prefix := ".".join(common_prefix.split(".")[:-1]): print(f"Suggested new key: {common_prefix}._global.IDENTIFIER_KEY") else: print("Suggested new key: _global.IDENTIFIER_KEY") @@ -75,7 +77,9 @@ def lower_and_remove_punctuation(value): value_to_be = "values are" print("") - raise ValueError(f"{len(json_repeat_value_counts)} repeat i18n {value_to_be} present. Please combine given the suggestions above.") + raise ValueError( + f"{len(json_repeat_value_counts)} repeat i18n {value_to_be} present. Please combine given the suggestions above." + ) else: print("\nSuccess: no repeat i18n values found.") diff --git a/frontend/i18n/check_unused_i18n_keys.py b/frontend/i18n/check_unused_i18n_keys.py index 96dd2af13..f771a4efd 100644 --- a/frontend/i18n/check_unused_i18n_keys.py +++ b/frontend/i18n/check_unused_i18n_keys.py @@ -12,7 +12,11 @@ this_directory = str(Path(__file__).parent.resolve()) frontend_directory = "/".join(this_directory.split("/")[:-1]) -directories_to_skip = [this_directory, f"{frontend_directory}/.nuxt", f"{frontend_directory}/node_modules"] +directories_to_skip = [ + this_directory, + f"{frontend_directory}/.nuxt", + f"{frontend_directory}/node_modules", +] file_types_to_check = [".vue", ".ts", ".js"] with open(f"{this_directory}/en-US.json") as f: @@ -20,7 +24,12 @@ files_to_check = [] for root, dirs, files in os.walk(frontend_directory): - files_to_check.extend(os.path.join(root, file) for file in files if all(root[:len(d)] != d for d in directories_to_skip) and any(file[-len(t):] == t for t in file_types_to_check)) + files_to_check.extend( + os.path.join(root, file) + for file in files + if all(root[: len(d)] != d for d in directories_to_skip) + and any(file[-len(t) :] == t for t in file_types_to_check) + ) all_keys = list(en_us_json_dict.keys()) used_keys = [] @@ -37,7 +46,9 @@ if unused_keys := list(set(all_keys) - set(used_keys)): to_be = "are" if len(unused_keys) > 1 else "is" key_to_be = "keys that are" if len(unused_keys) > 1 else "key that is" - raise ValueError(f"There {to_be} {len(unused_keys)} i18n {key_to_be} unused. Please remove or assign the following keys:\n{', '.join(unused_keys)}") + raise ValueError( + f"There {to_be} {len(unused_keys)} i18n {key_to_be} unused. Please remove or assign the following keys:\n{', '.join(unused_keys)}" + ) else: print("\nSuccess: all i18n keys are used in the project.") diff --git a/frontend/i18n/en-US.json b/frontend/i18n/en-US.json index f6bc97f28..a58cf023d 100644 --- a/frontend/i18n/en-US.json +++ b/frontend/i18n/en-US.json @@ -253,6 +253,7 @@ "components.modal-qr-code.section-2-list-1-item-2": "Adding them to flyers or cards", "components.modal-qr-code.section-2-list-1-item-3": "Sending them with materials for your organization", "components.modal-qr-code.subheader-2": "Ideas for OR code use include:", + "components.modal-share.header": "Share this page", "components.page-breadcrumbs.aria-label": "Page breadcrumb navigation", "components.password-strength.invalid": "invalid", "components.password-strength.medium": "medium", diff --git a/frontend/package.json b/frontend/package.json index 2740fffe5..c054911bc 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -54,6 +54,7 @@ "tailwindcss": "^3.3.2", "uuid": "^9.0.1", "v-calendar": "^3.1.1", + "vue-socials": "^2.0.4", "zxcvbn": "^4.4.2" } } diff --git a/frontend/pages/events/[id]/about.vue b/frontend/pages/events/[id]/about.vue index e92477a42..618ad4a9d 100644 --- a/frontend/pages/events/[id]/about.vue +++ b/frontend/pages/events/[id]/about.vue @@ -27,32 +27,11 @@ :counter="event.supporters" ariaLabel="components.btn-action.support-event-aria-label" /> - -