summaryrefslogtreecommitdiff
path: root/src/frontend/components/PlatformFlag
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/components/PlatformFlag')
-rw-r--r--src/frontend/components/PlatformFlag/PlatformFlag.styled.ts25
-rw-r--r--src/frontend/components/PlatformFlag/PlatformFlag.tsx16
-rw-r--r--src/frontend/components/PlatformFlag/index.ts4
3 files changed, 45 insertions, 0 deletions
diff --git a/src/frontend/components/PlatformFlag/PlatformFlag.styled.ts b/src/frontend/components/PlatformFlag/PlatformFlag.styled.ts
new file mode 100644
index 0000000..3ac0733
--- /dev/null
+++ b/src/frontend/components/PlatformFlag/PlatformFlag.styled.ts
@@ -0,0 +1,25 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+import styled from 'styled-components';
+
+export const Block = styled.div`
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ width: 100px;
+ height: 27px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: ${({ theme }) => theme.sizes.mSmall};
+ font-weight: ${({ theme }) => theme.fonts.regular};
+ color: ${({ theme }) => theme.colors.white};
+ background: ${({ theme }) => theme.colors.otelYellow};
+
+ ${({ theme }) => theme.breakpoints.desktop} {
+ width: 190px;
+ height: 50px;
+ font-size: ${({ theme }) => theme.sizes.dSmall};
+ }
+`;
diff --git a/src/frontend/components/PlatformFlag/PlatformFlag.tsx b/src/frontend/components/PlatformFlag/PlatformFlag.tsx
new file mode 100644
index 0000000..80a01ca
--- /dev/null
+++ b/src/frontend/components/PlatformFlag/PlatformFlag.tsx
@@ -0,0 +1,16 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+import * as S from './PlatformFlag.styled';
+
+const { NEXT_PUBLIC_PLATFORM = 'local' } = typeof window !== 'undefined' ? window.ENV : {};
+
+const platform = NEXT_PUBLIC_PLATFORM;
+
+const PlatformFlag = () => {
+ return (
+ <S.Block>{platform}</S.Block>
+ );
+};
+
+export default PlatformFlag;
diff --git a/src/frontend/components/PlatformFlag/index.ts b/src/frontend/components/PlatformFlag/index.ts
new file mode 100644
index 0000000..ea744bb
--- /dev/null
+++ b/src/frontend/components/PlatformFlag/index.ts
@@ -0,0 +1,4 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+export { default } from './PlatformFlag';