parent
ad33191a4d
commit
d835448206
@ -0,0 +1,25 @@
|
||||
.tacky {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.tacky li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tacky li:after {
|
||||
content: "-";
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.tacky li:last-of-type:after {
|
||||
content: "";
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tacky li.no-tack:after {
|
||||
content: "";
|
||||
margin: 0;
|
||||
display: none;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
/* eslint react/prop-types: 0 */
|
||||
import { useState } from 'react';
|
||||
import { useRef } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export const useBbox = () => {
|
||||
const ref = useRef();
|
||||
const [bbox, setBbox] = useState({});
|
||||
|
||||
const set = () =>
|
||||
setBbox(ref && ref.current ? ref.current.getBoundingClientRect() : {});
|
||||
|
||||
useEffect(() => {
|
||||
set();
|
||||
window.addEventListener('resize', set);
|
||||
return () => window.removeEventListener('resize', set);
|
||||
}, []);
|
||||
|
||||
return [bbox, ref];
|
||||
};
|
Loading…
Reference in new issue