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

Custom tooltip component. #24

Open
dolby360 opened this issue Sep 1, 2022 · 0 comments
Open

Custom tooltip component. #24

dolby360 opened this issue Sep 1, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@dolby360
Copy link
Owner

dolby360 commented Sep 1, 2022

Right now the tooltip component is hard coded in the item file. And honestly, I'm not extremely happy with the styling.

I think we shall provide the users the option to pass component styling using props. For example:

const costumeStyle = {/*some style here*/}

<HexColorDisplay 
toolTipStyle={costumeStyle }
offsets={data_example} 
bin={raw} 
/>

Please make sure you pass this style through here, and it shall be something like this:

            <Item
               toolTipsStyle={this.props.toolTipStyle}
                byteString={byteString}
                gId={gid}
                iId={iid}
                updateItemsStyle={this.updateItems}
                myStyle={style}
                data={data}
                indexInList={index}
                color={color}
                masterGid={masterGid}
            />

Eventually, this shall seep down to Tippy component here. Item shall have a check if this prop is undefined or not, If undefine then use default. otherwise use customized props.

export const Item = (props) => {
   let toolTipStyle = someDefault;
    if(props.toolTipStyle ...........){
       toolTipStyle = props.toolTipStyle
   }
    return(
        <Tippy content={<p style={toolTipStyle}>{props.data}</p>}>
            <li key={props.indexInList} style={getStyle(props.myStyle,props)}
            onMouseOver={ () => mouseEvent(props) } 
            >
                {props.byteString}
            </li>
        </Tippy>
    )
}

Please make sure you update the readme with this new feature.
Please add a story to storybook to demonstrate this feature.
Please check the contribution.md file.

@dolby360 dolby360 added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant