diff --git a/pkg/webui/console/components/live-data-button/index.js b/pkg/webui/console/components/live-data-button/index.js deleted file mode 100644 index b41fad04be8..00000000000 --- a/pkg/webui/console/components/live-data-button/index.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright © 2024 The Things Network Foundation, The Things Industries B.V. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import React, { useCallback } from 'react' -import { defineMessages } from 'react-intl' -import PropTypes from 'prop-types' - -import Icon, { IconChevronUp } from '@ttn-lw/components/icon' - -import Message from '@ttn-lw/lib/components/message' - -import style from './live-data-button.styl' - -const m = defineMessages({ - liveData: 'Live Data', -}) - -const LiveDataButton = props => { - const { setIsOpen } = props - - const handleClick = useCallback(() => { - setIsOpen(true) - }, [setIsOpen]) - - return ( -
- -
- ) -} - -LiveDataButton.propTypes = { - setIsOpen: PropTypes.func.isRequired, -} -LiveDataButton.defaultProps = {} - -export default LiveDataButton diff --git a/pkg/webui/console/components/live-data-button/live-data-button.styl b/pkg/webui/console/components/live-data-button/live-data-button.styl deleted file mode 100644 index a616a9b6293..00000000000 --- a/pkg/webui/console/components/live-data-button/live-data-button.styl +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright © 2024 The Things Network Foundation, The Things Industries B.V. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -.container - text-align: right - -.button - position: relative - display: inline-flex - transition: 80ms background ease-in-out, 80ms color ease-in-out, 80ms border-color ease-in-out, 80ms box-shadow ease-in-out - border-radius: $br.xl3 - outline: 0 - cursor: pointer - justify-content: center - align-items: center - gap: $cs.xxs - height: $ls.m - text-decoration: none - padding: 0 $cs.m - white-space: nowrap - box-sizing: border-box - color: var(--c-text-neutral-min) - background-color: var(--c-bg-neutral-heavy) - border: 1px solid transparent - - &:hover - background-color: var(--c-bg-neutral-heavy-hover) - - .icon - margin-left: - $cs.xxs - flex-shrink: 0 diff --git a/pkg/webui/console/containers/event-split-frame/event-split-frame.styl b/pkg/webui/console/containers/event-split-frame/event-split-frame.styl index f9143fcd05a..364d6f44e36 100644 --- a/pkg/webui/console/containers/event-split-frame/event-split-frame.styl +++ b/pkg/webui/console/containers/event-split-frame/event-split-frame.styl @@ -55,3 +55,23 @@ bottom: $cs.s padding: $cs.xxs width: fit-content + +.live-data-button + position: relative + display: inline-flex + transition: 80ms background ease-in-out, 80ms color ease-in-out, 80ms border-color ease-in-out, 80ms box-shadow ease-in-out + outline: 0 + cursor: pointer + justify-content: center + align-items: center + gap: $cs.xxs + height: $ls.m + text-decoration: none + padding: 0 $cs.m + border-radius: $br.xl3 + color: var(--c-text-neutral-min) + background-color: var(--c-bg-neutral-heavy) + border: 1px solid transparent + + &:hover + background-color: var(--c-bg-neutral-heavy-hover) diff --git a/pkg/webui/console/containers/event-split-frame/index.js b/pkg/webui/console/containers/event-split-frame/index.js index 223ecc711b9..7777bee7923 100644 --- a/pkg/webui/console/containers/event-split-frame/index.js +++ b/pkg/webui/console/containers/event-split-frame/index.js @@ -15,10 +15,13 @@ import React, { useContext, useCallback, useRef, useEffect } from 'react' import DOM from 'react-dom' import { useDispatch, useSelector } from 'react-redux' +import { defineMessages } from 'react-intl' + +import Button from '@ttn-lw/components/button' +import { IconChevronUp } from '@ttn-lw/components/icon' import RequireRequest from '@ttn-lw/lib/components/require-request' -import LiveDataButton from '@console/components/live-data-button' import LiveDataTutorial from '@console/components/live-data-tutorial' import PropTypes from '@ttn-lw/lib/prop-types' @@ -35,6 +38,10 @@ import EventSplitFrameContext from './context' import style from './event-split-frame.styl' +const m = defineMessages({ + liveData: 'Live Data', +}) + const EventSplitFrameInner = ({ children }) => { const { isOpen, height, isActive, setHeight, setIsMounted, setIsOpen } = useContext(EventSplitFrameContext) @@ -104,7 +111,12 @@ const EventSplitFrameInner = ({ children }) => { {isActive && !isOpen && (
- +
)} diff --git a/pkg/webui/locales/en-duplicates.json b/pkg/webui/locales/en-duplicates.json new file mode 100644 index 00000000000..b5ff1948535 --- /dev/null +++ b/pkg/webui/locales/en-duplicates.json @@ -0,0 +1,9 @@ +[ + { + "message": "Live Data", + "ids": [ + "console.components.live-data-button.index.liveData", + "console.containers.event-split-frame.index.liveData" + ] + } +] \ No newline at end of file diff --git a/pkg/webui/locales/en.json b/pkg/webui/locales/en.json index 42699704f33..6f0ef43d3de 100644 --- a/pkg/webui/locales/en.json +++ b/pkg/webui/locales/en.json @@ -538,6 +538,7 @@ "console.containers.email-notifications-form.index.unsubscribeDescription": "You will continue to receive notifications in the console.", "console.containers.email-notifications-form.index.discardChanges": "Discard changes", "console.containers.email-notifications-form.index.updateEmailPreferences": "Updated email preferences", + "console.containers.event-split-frame.index.liveData": "Live Data", "console.containers.freq-plans-select.utils.warning": "Frequency plans unavailable", "console.containers.freq-plans-select.utils.none": "Do not set a frequency plan", "console.containers.freq-plans-select.utils.selectFrequencyPlan": "Select a frequency plan...", diff --git a/pkg/webui/locales/ja.json b/pkg/webui/locales/ja.json index 33b67f9657c..eef258df672 100644 --- a/pkg/webui/locales/ja.json +++ b/pkg/webui/locales/ja.json @@ -538,6 +538,7 @@ "console.containers.email-notifications-form.index.unsubscribeDescription": "", "console.containers.email-notifications-form.index.discardChanges": "", "console.containers.email-notifications-form.index.updateEmailPreferences": "", + "console.containers.event-split-frame.index.liveData": "", "console.containers.freq-plans-select.utils.warning": "", "console.containers.freq-plans-select.utils.none": "", "console.containers.freq-plans-select.utils.selectFrequencyPlan": "",