Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip remove #2754

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions bundles/framework/mydata/view/embedded/SnippetPopup.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Message, Tooltip, CopyField } from 'oskari-ui';
import { Message, CopyField } from 'oskari-ui';
import styled from 'styled-components';
import { SecondaryButton, ButtonContainer, CopyButton } from 'oskari-ui/components/buttons';
import { showPopup } from 'oskari-ui/components/window';
Expand All @@ -16,15 +15,15 @@ const Content = styled.div`
margin: 12px 24px 24px;
`;

const SnippetPopup = ({html, onClose}) => {
const SnippetPopup = ({ html, onClose }) => {
const [highlighted, setHighlighted] = useState(false);

const highlightUrl = () => {
setHighlighted(true);
setTimeout(() => {
setHighlighted(false);
}, 1000);
}
};

return (
<Content>
Expand All @@ -35,16 +34,17 @@ const SnippetPopup = ({html, onClose}) => {
/>
<ButtonContainer>
<SecondaryButton type='cancel' onClick={onClose}/>
<Tooltip title={<Message messageKey={`tabs.publishedmaps.published.copy`} />}>
<CopyButton
value={html}
onClick={() => highlightUrl()}
/>
</Tooltip>
<CopyButton
value={html}
onClick={() => highlightUrl()}/>
</ButtonContainer>
</Content>
);
};
SnippetPopup.propTypes = {
html: PropTypes.string.isRequired,
onClose: PropTypes.func.isRequired
};

export const showSnippetPopup = (view, onClose) => {
const title = <Message messageKey="tabs.publishedmaps.getHTML" bundleKey={BUNDLE_NAME} />;
Expand All @@ -68,9 +68,4 @@ export const showSnippetPopup = (view, onClose) => {
</LocaleProvider>
);
return showPopup(title, content, onClose, POPUP_OPTIONS);
}

showSnippetPopup.propTypes = {
view: PropTypes.object,
onClose: PropTypes.func.isRequired
};
5 changes: 3 additions & 2 deletions src/react/components/Pagination.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { Pagination as AntPagination } from 'antd';

export const Pagination = ({ children, ...other}) => (
<AntPagination { ...other }>
// No tooltip localization default to showTitle false
export const Pagination = ({ children, showTitle = false, ...other}) => (
<AntPagination showTitle={showTitle} { ...other }>
{ children }
</AntPagination>
);