--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table('technique_maps', function(Blueprint $table) {
+ $table->string('marker')->nullable()->default(null);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('technique_maps', function(Blueprint $table) {
+ $table->dropColumn('marker');
+ });
+ }
+};
}
};
-const ZeldaIcon = ({ name }) => {
+const ZeldaIcon = ({ name, title }) => {
const { t } = useTranslation();
const invert = name.startsWith('not-');
const strippedName = invert ? name.substr(4) : name;
const src = getIconURL(strippedName);
- const title = t(`icon.zelda.${name}`);
+ const alt = t(`icon.zelda.${name}`);
+ const realTitle = title !== '' ? title || alt : null;
return <span className="zelda-icon">
{src ?
<img
- alt={title}
+ alt={alt}
src={src}
- title={title}
+ title={realTitle}
/>
: null}
{invert ?
ZeldaIcon.propTypes = {
name: PropTypes.string,
+ title: PropTypes.string,
};
export default ZeldaIcon;
import Overlay from './Overlay';
import Popover from './Popover';
import Icon from '../common/Icon';
+import ZeldaIcon from '../common/ZeldaIcon';
import { getLink, getTranslation } from '../../helpers/Technique';
import i18n from '../../i18n';
}
}, [pin]);
+ const title = React.useMemo(() => {
+ return getTranslation(pin.technique, 'title', i18n.language);
+ }, [pin, i18n.language]);
+
return <Overlay onClick={onClick} x={pin.x} y={pin.y}>
<div className="map-pin">
<Link to={getLink(pin.technique)}>
- <Icon.PIN title={getTranslation(pin.technique, 'title', i18n.language)} />
+ {pin.marker ?
+ <ZeldaIcon title={title} name={pin.marker} />
+ :
+ <Icon.PIN title={title} />
+ }
</Link>
{pin.technique.type === 'location' ?
<div ref={ref}>
Pin.propTypes = {
pin: PropTypes.shape({
+ marker: PropTypes.string,
technique: PropTypes.shape({
type: PropTypes.string,
}),
stroke-width: 1px;
vector-effect: non-scaling-stroke;
}
+ > a .zelda-icon {
+ height: 1em;
+ width: 1em;
+ }
}
.map-popover {