From a63484b65911ba431657838dcf1d882aa6bc948e Mon Sep 17 00:00:00 2001 From: Kyle Baran Date: Mon, 15 Apr 2024 17:38:17 -0700 Subject: [PATCH] Updated Twitter/Facebook naming to X/Meta Only did this for user-facing naming and icons. OAuth routing still has to be twitter/facebook since grant still uses those, as do the services' routing themselves. Decided not to change ENV_VARs and database naming to avoid bugs. --- packages/client-core/i18n/en/admin.json | 6 +- packages/client-core/i18n/en/social.json | 6 +- packages/client-core/i18n/en/user.json | 4 +- packages/client-core/package.json | 2 +- .../src/admin/components/Users/UserDrawer.tsx | 6 +- .../src/admin/components/Users/UserTable.tsx | 4 +- .../settings/tabs/authentication.tsx | 28 ++++--- .../components/user/AccountIdentifiers.tsx | 11 +-- .../src/common/components/Icons/MetaIcon.tsx | 79 +++++++++++++++++++ .../src/common/components/Icons/XIcon.tsx | 38 +++++++++ .../user/components/Oauth/TwitterCallback.tsx | 2 +- .../components/UserMenu/menus/ProfileMenu.tsx | 12 +-- packages/client/package.json | 2 +- packages/editor/package.json | 2 +- packages/ui/package.json | 2 +- packages/ui/src/primitives/mui/Icon/index.tsx | 6 +- 16 files changed, 168 insertions(+), 42 deletions(-) create mode 100755 packages/client-core/src/common/components/Icons/MetaIcon.tsx create mode 100755 packages/client-core/src/common/components/Icons/XIcon.tsx diff --git a/packages/client-core/i18n/en/admin.json b/packages/client-core/i18n/en/admin.json index c3c926f3a86a..986816f97561 100755 --- a/packages/client-core/i18n/en/admin.json +++ b/packages/client-core/i18n/en/admin.json @@ -364,11 +364,11 @@ "host": "Host", "protocol": "Protocol", "discord": "Discord", - "facebook": "Facebook", + "facebook": "Meta", "google": "Google", "github": "Github", "linkedIn": "LinkedIn", - "twitter": "Twitter", + "twitter": "X", "key": "Key", "callback": "Callback", "appTitle": "App Title", @@ -626,7 +626,7 @@ "userSearch": "user by id, name or account identifier", "linkedAccounts": "Linked Accounts", "discord": "Discord", - "facebook": "Facebook", + "facebook": "Meta", "google": "Google", "github": "Github", "linkedIn": "LinkedIn", diff --git a/packages/client-core/i18n/en/social.json b/packages/client-core/i18n/en/social.json index 15e497a66c8f..66c1d9f9ad26 100755 --- a/packages/client-core/i18n/en/social.json +++ b/packages/client-core/i18n/en/social.json @@ -65,7 +65,7 @@ "ph-tags": "Tags", "ph-link": "Link", "ph-aboutYou": "More about you", - "ph-twitter": "twitter", + "ph-twitter": "x", "ph-instagram": "instagram", "ph-tiktok": "tiktok", "sign-out": "Sign-Out" @@ -191,10 +191,10 @@ }, "registration": { "ph-phoneEmail": "Use phone / email", - "facebook": "Continue with Facebook", + "facebook": "Continue with Meta", "google": "Continue with Google", "linkedin": "Continue with Linkedin", - "twitter": "Continue with Twitter", + "twitter": "Continue with X", "gitHub": "Continue with GitHub", "connect": "Connect your email or phone number", "logIn": "Log in", diff --git a/packages/client-core/i18n/en/user.json b/packages/client-core/i18n/en/user.json index 45392f312532..1994c896bd7b 100755 --- a/packages/client-core/i18n/en/user.json +++ b/packages/client-core/i18n/en/user.json @@ -38,9 +38,9 @@ "social": { "gitHub": "Login with GitHub", "google": "Login with Google", - "facebook": "Login with Facebook", + "facebook": "Login with Meta", "linkedin": "Login with Linkedin", - "twitter": "Login with Twitter" + "twitter": "Login with X" }, "register": { "header": "Sign Up", diff --git a/packages/client-core/package.json b/packages/client-core/package.json index 1081b93b8b7a..af724ac7154c 100755 --- a/packages/client-core/package.json +++ b/packages/client-core/package.json @@ -39,7 +39,7 @@ "@hookstate/core": "4.0.0-rc21", "@hookstate/localstored": "4.0.0-rc21", "@iconify/react": "4.1.0", - "@mui/icons-material": "5.11.11", + "@mui/icons-material": "5.15.15", "@mui/lab": "5.0.0-alpha.94", "@mui/material": "5.11.13", "@mui/x-date-pickers": "6.9.2", diff --git a/packages/client-core/src/admin/components/Users/UserDrawer.tsx b/packages/client-core/src/admin/components/Users/UserDrawer.tsx index 607700e23ddc..dcd86786dc30 100644 --- a/packages/client-core/src/admin/components/Users/UserDrawer.tsx +++ b/packages/client-core/src/admin/components/Users/UserDrawer.tsx @@ -56,6 +56,8 @@ import { useFind, useMutation } from '@etherealengine/spatial/src/common/functio import { DiscordIcon } from '../../../common/components/Icons/DiscordIcon' import { GoogleIcon } from '../../../common/components/Icons/GoogleIcon' import { LinkedInIcon } from '../../../common/components/Icons/LinkedInIcon' +import { MetaIcon } from '../../../common/components/Icons/MetaIcon' +import { XIcon } from '../../../common/components/Icons/XIcon' import { NotificationService } from '../../../common/services/NotificationService' import { userHasAccess } from '../../../user/userHasAccess' import DrawerView from '../../common/DrawerView' @@ -130,7 +132,7 @@ export const LinkedProviders = (props: { selectedUser?: UserType }) => { {facebookIp && ( - + {facebookIp.accountIdentifier!} @@ -140,7 +142,7 @@ export const LinkedProviders = (props: { selectedUser?: UserType }) => { {twitterIp && ( - + {twitterIp.accountIdentifier!} diff --git a/packages/client-core/src/admin/components/Users/UserTable.tsx b/packages/client-core/src/admin/components/Users/UserTable.tsx index dff1c280cf2a..37988e8ca6eb 100644 --- a/packages/client-core/src/admin/components/Users/UserTable.tsx +++ b/packages/client-core/src/admin/components/Users/UserTable.tsx @@ -46,7 +46,7 @@ import { DiscordIcon } from '../../../common/components/Icons/DiscordIcon' import { FacebookIcon } from '../../../common/components/Icons/FacebookIcon' import { GoogleIcon } from '../../../common/components/Icons/GoogleIcon' import { LinkedInIcon } from '../../../common/components/Icons/LinkedInIcon' -import { TwitterIcon } from '../../../common/components/Icons/TwitterIcon' +import { XIcon } from '../../../common/components/Icons/XIcon' import { AuthState } from '../../../user/services/AuthService' import TableComponent from '../../common/Table' import { UserData, UserProps, userColumns } from '../../common/variables/user' @@ -126,7 +126,7 @@ const UserTable = ({ className, search, skipGuests }: UserProps & { skipGuests: )} {twitterIp && ( - + )} {linkedinIp && ( diff --git a/packages/client-core/src/admin2/components/settings/tabs/authentication.tsx b/packages/client-core/src/admin2/components/settings/tabs/authentication.tsx index f6ea458f5c3a..5075fc5dc618 100644 --- a/packages/client-core/src/admin2/components/settings/tabs/authentication.tsx +++ b/packages/client-core/src/admin2/components/settings/tabs/authentication.tsx @@ -202,18 +202,22 @@ const AuthenticationTab = forwardRef(({ open }: { open: boolean }, ref: React.Mu
- {Object.keys(state.value).map((strategyName, i) => ( - onSwitchHandle(state[strategyName], value)} - /> - ))} + {Object.keys(state.value).map((strategyName, i) => { + const displayStrategyName = + strategyName === 'twitter' ? 'x' : strategyName === 'facebook' ? 'meta' : strategyName + return ( + onSwitchHandle(state[strategyName], value)} + /> + ) + })}
diff --git a/packages/client-core/src/admin2/components/user/AccountIdentifiers.tsx b/packages/client-core/src/admin2/components/user/AccountIdentifiers.tsx index b0edf3618251..e16ddf860eb7 100644 --- a/packages/client-core/src/admin2/components/user/AccountIdentifiers.tsx +++ b/packages/client-core/src/admin2/components/user/AccountIdentifiers.tsx @@ -29,11 +29,12 @@ import React from 'react' import { MdEmail } from 'react-icons/md' import { RiDiscordFill, - RiFacebookBoxFill, RiGithubFill, RiGoogleFill, + RiLinkedinFill, RiMessage2Line, - RiTwitterFill + RiMetaFill, + RiTwitterXFill } from 'react-icons/ri' export default function AccountIdentifiers({ user }: { user: UserType }) { @@ -60,17 +61,17 @@ export default function AccountIdentifiers({ user }: { user: UserType }) { ) : null} {facebookIp ? ( - + ) : null} {twitterIp ? ( - + ) : null} {linkedinIp ? ( - + ) : null} {githubIp ? ( diff --git a/packages/client-core/src/common/components/Icons/MetaIcon.tsx b/packages/client-core/src/common/components/Icons/MetaIcon.tsx new file mode 100755 index 000000000000..3756aafccf63 --- /dev/null +++ b/packages/client-core/src/common/components/Icons/MetaIcon.tsx @@ -0,0 +1,79 @@ +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ + +import React from 'react' + +import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon' + +export const MetaIcon = (props: SvgIconProps) => { + return ( + + + + + + + + + + + + + + + + + + ) +} diff --git a/packages/client-core/src/common/components/Icons/XIcon.tsx b/packages/client-core/src/common/components/Icons/XIcon.tsx new file mode 100755 index 000000000000..cf44c836df24 --- /dev/null +++ b/packages/client-core/src/common/components/Icons/XIcon.tsx @@ -0,0 +1,38 @@ +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ + +import React from 'react' + +import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon' + +export const XIcon = (props: SvgIconProps) => { + return ( + + + + + + ) +} diff --git a/packages/client-core/src/user/components/Oauth/TwitterCallback.tsx b/packages/client-core/src/user/components/Oauth/TwitterCallback.tsx index e0bbaca03fee..bd62214d2eab 100755 --- a/packages/client-core/src/user/components/Oauth/TwitterCallback.tsx +++ b/packages/client-core/src/user/components/Oauth/TwitterCallback.tsx @@ -68,7 +68,7 @@ const TwitterCallbackComponent = (props): JSX.Element => { return state.error && state.error !== '' ? ( -
{t('user:oauth.authFailed', { service: 'Twitter' })}
+
{t('user:oauth.authFailed', { service: 'X' })}
{state.error}