JSFiddle - React, Tailwind, and code Playground

HTML

<div class="container">
    <div class="cover-photo-container">This needs to be fixed when hits top of screen</div>
    <div class="small-box"></div>
    <div class="small-box"></div>
    <div class="small-box"></div>
    <div class="small-box"></div>
    <div class="clear">
        <div>
            <div class="sticky-header">Scroll</div>
        </div>

CSS

body {
    margin:0px;
    padding:0px;
}
.clear {
    clear:both;
}
.container {
    height:2000px;
}
.cover-photo-container {
    width:700px;
    height: 100px;
    margin-bottom: 20px;
    background-color:grey;
}

.fixed {
    position: fixed;
    top:0; left:0;
    width: 100%; }

.small-box {
    width:163px;
    height:100px;
    border:1px solid black;
    float:left;
}
.sticky-header {
    width:700px;
    height:50px;
    background:blue;
    postion:fixed;
}

JavaScript

$(window).scroll(function(){
    if ($(window).scrollTop() >= 100) {
       $('.cover-photo-container').addClass('fixed');
    }
    else {
       $('.cover-photo-container').removeClass('fixed');
    }
});