diff --git a/src/features/widgets/quicklinks/options/QuickLink.jsx b/src/features/widgets/quicklinks/options/QuickLink.jsx new file mode 100644 index 00000000..968af7e7 --- /dev/null +++ b/src/features/widgets/quicklinks/options/QuickLink.jsx @@ -0,0 +1,68 @@ +import variables from 'config/variables'; + +import { MdEdit, MdCancel } from 'react-icons/md'; + +const QuickLink = ({ item, deleteLink, startEditLink }) => { + let target, + rel = null; + if (localStorage.getItem('quicklinksnewtab') === 'true') { + target = '_blank'; + rel = 'noopener noreferrer'; + } + + const useText = localStorage.getItem('quicklinksText') === 'true'; + + if (useText) { + return ( + deleteLink(item.key, e)} + href={item.url} + target={target} + rel={rel} + draggable={false} + > + {item.name} + + ); + } + + const img = + item.icon || + 'https://icon.horse/icon/ ' + item.url.replace('https://', '').replace('http://', ''); + + return ( +
+
+ {item.name} +
+
+
{item.name}
+
+ + {item.url} + +
+
+
+
+ + +
+
+
+ ); +}; + +export { QuickLink as default, QuickLink }; diff --git a/src/features/widgets/quicklinks/options/QuickLinksOptions.jsx b/src/features/widgets/quicklinks/options/QuickLinksOptions.jsx index 2da4b778..80be3336 100644 --- a/src/features/widgets/quicklinks/options/QuickLinksOptions.jsx +++ b/src/features/widgets/quicklinks/options/QuickLinksOptions.jsx @@ -9,7 +9,7 @@ import Modal from 'react-modal'; import { AddModal } from 'components/Elements/AddModal'; import EventBus from 'utils/eventbus'; -import { QuickLink } from '../QuickLinks'; +import { QuickLink } from './QuickLink'; import { getTitleFromUrl, isValidUrl } from 'utils/links'; class QuickLinksOptions extends PureComponent { @@ -272,4 +272,4 @@ class QuickLinksOptions extends PureComponent { } } -export { QuickLinksOptions as default, QuickLinksOptions }; \ No newline at end of file +export { QuickLinksOptions as default, QuickLinksOptions }; diff --git a/src/features/widgets/weather/Weather.jsx b/src/features/widgets/weather/Weather.jsx index 5b11348f..0f5c283f 100644 --- a/src/features/widgets/weather/Weather.jsx +++ b/src/features/widgets/weather/Weather.jsx @@ -6,7 +6,7 @@ import Expanded from './components/Expanded'; import EventBus from 'utils/eventbus'; -import { getWeather } from './api/WeatherAPI.js'; +import { getWeather } from './api/getWeather.js'; import './weather.scss'; @@ -53,6 +53,7 @@ class WeatherWidget extends PureComponent { return (
+ {this.state.done === false ?

cheese

:

loading finished

}
diff --git a/src/features/widgets/weather/api/WeatherAPI.js b/src/features/widgets/weather/api/getWeather.js similarity index 100% rename from src/features/widgets/weather/api/WeatherAPI.js rename to src/features/widgets/weather/api/getWeather.js